mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
refactor: expand api and chain config snapshots
This commit is contained in:
@@ -132,10 +132,19 @@ sys.modules["app.application.site.sites"] = sites
|
||||
|
||||
from fastapi.security import HTTPAuthorizationCredentials
|
||||
from app import schemas
|
||||
from app.api.endpoints import anthropic, openai
|
||||
from app.api.endpoints.anthropic import messages as anthropic_messages
|
||||
from app.api.endpoints.openai import chat_completions, responses
|
||||
from app.application.configuration import ApiRuntimeConfig
|
||||
from app.runtime.config import settings
|
||||
|
||||
runtime_config = ApiRuntimeConfig(
|
||||
False, 60, False, settings.AI_AGENT_ENABLE,
|
||||
api_token=settings.API_TOKEN,
|
||||
)
|
||||
anthropic.get_api_runtime_config_snapshot = lambda: runtime_config
|
||||
openai.get_api_runtime_config_snapshot = lambda: runtime_config
|
||||
|
||||
credentials = HTTPAuthorizationCredentials(
|
||||
scheme="Bearer",
|
||||
credentials=settings.API_TOKEN,
|
||||
@@ -367,9 +376,16 @@ sys.modules["app.application.site.sites"] = sites
|
||||
from fastapi.security import HTTPAuthorizationCredentials
|
||||
from app import schemas
|
||||
from app.api.endpoints import anthropic, openai
|
||||
from app.application.configuration import ApiRuntimeConfig
|
||||
from app.runtime.config import settings
|
||||
|
||||
settings.AI_AGENT_ENABLE = True
|
||||
runtime_config = ApiRuntimeConfig(
|
||||
False, 60, False, True,
|
||||
api_token=settings.API_TOKEN,
|
||||
)
|
||||
anthropic.get_api_runtime_config_snapshot = lambda: runtime_config
|
||||
openai.get_api_runtime_config_snapshot = lambda: runtime_config
|
||||
credentials = HTTPAuthorizationCredentials(
|
||||
scheme="Bearer",
|
||||
credentials=settings.API_TOKEN,
|
||||
|
||||
Reference in New Issue
Block a user