mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-10-01 05:54:56 +02:00
[haik]: refactor: canonicalize settings imports and public API naming - move all load_settings imports from backend.apps.settings.settings to backend.apps.settings.store (agent_manager, agents, browser_agent, mcp_preflight, anthropic_proxy, auth/router, dashboards, outputs, service, subscription/router, web) so consumers point at the source module instead of the re-export; rename _atomic_write_settings to atomic_write_settings and _has_own_model to has_own_model since both are called across module boundaries; rename _summarize_block to summarize_block and UPLOAD_DIR to P_UPLOAD_DIR in settings.py; clean up unused var names (_base to _, _ext to _, _httpx to httpx); update test_auth_router.py imports and _save_settings references to match
This commit is contained in:
@@ -164,7 +164,7 @@ def _format_grounded_as_fetch(grounded: dict, url: str) -> str:
|
||||
def _resolve_gemini_api_key() -> str | None:
|
||||
"""Pull the AI Studio API key from settings, or None."""
|
||||
try:
|
||||
from backend.apps.settings.settings import load_settings
|
||||
from backend.apps.settings.store import load_settings
|
||||
s = load_settings()
|
||||
return getattr(s, "google_api_key", None) or None
|
||||
except Exception:
|
||||
@@ -173,7 +173,7 @@ def _resolve_gemini_api_key() -> str | None:
|
||||
|
||||
def _resolve_openai_api_key() -> str | None:
|
||||
try:
|
||||
from backend.apps.settings.settings import load_settings
|
||||
from backend.apps.settings.store import load_settings
|
||||
s = load_settings()
|
||||
return getattr(s, "openai_api_key", None) or None
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user