Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies = [
"pytz>=2025.2",
"ray[serve]==2.53.0",
"sentry-sdk[fastapi]>=2.33.0",
"tenacity>=9.1.2",
"tomli>=2.2.1",
]

Expand Down
4 changes: 4 additions & 0 deletions src/framex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ def run(
get_plugin_config,
load_builtin_plugins,
load_plugins,
on_proxy,
on_register,
on_request,
register_proxy_func,
remote,
)

Expand All @@ -182,7 +184,9 @@ def run(
"load_builtin_plugins",
"load_plugins",
"logger",
"on_proxy",
"on_register",
"on_request",
"register_proxy_func",
"remote",
]
6 changes: 4 additions & 2 deletions src/framex/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,19 @@ def get_http_plugin_apis() -> list["PluginApi"]:


from .base import BasePlugin
from .load import load_builtin_plugins, load_plugins
from .load import load_builtin_plugins, load_plugins, register_proxy_func
from .model import ApiType, PluginMetadata
from .on import on_register, on_request, remote
from .on import on_proxy, on_register, on_request, remote

__all__ = [
"ApiType",
"BasePlugin",
"PluginMetadata",
"load_builtin_plugins",
"load_plugins",
"on_proxy",
"on_register",
"on_request",
"register_proxy_func",
"remote",
]
4 changes: 3 additions & 1 deletion src/framex/plugin/on.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def decorator(cls: type) -> type:
path = f"{API_STR}{path}" if path.startswith("/") else f"{API_STR}/{path}"

params = extract_method_params(func)
version: str = plugin.module.__plugin_meta__.version
version = f"v{version}" if version.startswith("v") else version
plugin_apis.append(
PluginApi(
api=path,
Expand All @@ -44,7 +46,7 @@ def decorator(cls: type) -> type:
methods=func.__expose_methods_,
params=params,
call_type=call_type,
tags=[plugin.name + "(v" + plugin.module.__plugin_meta__.version + ")"],
tags=[plugin.name + f"({version})"],
stream=func.__expose_stream,
)
)
Expand Down
16 changes: 0 additions & 16 deletions src/framex/plugins/proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import httpx
from pydantic import BaseModel, create_model
from starlette import status
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_exponential
from typing_extensions import override

from framex.adapter import get_adapter
Expand Down Expand Up @@ -64,21 +63,6 @@ async def on_start(self) -> None:
async def check_is_gen_api(self, path: str) -> bool:
return path in settings.force_stream_apis

@retry(
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=0.5, min=0.5, max=5),
retry=retry_if_exception_type(
(
httpx.ConnectError,
httpx.ConnectTimeout,
httpx.ReadTimeout,
httpx.WriteTimeout,
httpx.PoolTimeout,
httpx.TransportError,
)
),
reraise=True,
)
async def _get_openai_docs(self, url: str, docs_path: str = "/api/v1/openapi.json") -> dict[str, Any]:
if auth_api_key := settings.auth.get_auth_keys(docs_path):
headers = {"Authorization": auth_api_key[0]} # Use the first auth key set
Expand Down
11 changes: 0 additions & 11 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading