sprint1: agent queue worker, proxy support, auto-mark-on-navigate-away, test fixes
This commit is contained in:
@@ -9,6 +9,11 @@ from db import DB_PATH
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def proxy_from_env():
|
||||
"""Return proxy URL from HTTP_PROXY/HTTPS_PROXY env vars, or None."""
|
||||
return os.environ.get("HTTP_PROXY") or os.environ.get("http_proxy") or \
|
||||
os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy") or None
|
||||
|
||||
# Fallback pattern to retrieve the correct bytecatcode credentials
|
||||
API_KEY = os.environ.get("DEEPSEEK_API_KEY", os.environ.get("OPENAI_API_KEY", ""))
|
||||
BASE_URL = os.environ.get("DEEPSEEK_BASE_URL", "https://api.deepseek.com")
|
||||
@@ -108,7 +113,7 @@ async def summarize_video(video_id: str) -> str | None:
|
||||
]
|
||||
}
|
||||
|
||||
async with httpx.AsyncClient(timeout=120) as client:
|
||||
async with httpx.AsyncClient(proxy=proxy_from_env(), timeout=120) as client:
|
||||
try:
|
||||
resp = await client.post(
|
||||
f"{BASE_URL}/v1/chat/completions",
|
||||
|
||||
Reference in New Issue
Block a user