SysOps: manual — 2026-07-30 09:33 UTC

This commit is contained in:
sysops
2026-07-30 09:33:03 +00:00
parent f21d58483b
commit 5dd69a1138
25 changed files with 4148 additions and 734 deletions
+34 -1
View File
@@ -276,6 +276,39 @@ async def api_tenders(country: Optional[str] = None, status: Optional[str] = "op
return await _proxy("GET", "/tenders", params=params)
@router.get("/api/export-intel/settings")
async def api_export_intel_settings_get():
return await _proxy("GET", "/settings")
@router.put("/api/export-intel/settings")
async def api_export_intel_settings_put(request: Request):
body = await request.json()
async with httpx.AsyncClient(timeout=30.0) as client:
r = await client.put(f"{TOOLS}/export-intel/settings", json=body)
return r.json()
@router.post("/api/export-intel/sync/places")
async def api_sync_places(request: Request):
body = {}
if request.headers.get("content-type", "").startswith("application/json"):
try:
body = await request.json()
except Exception:
body = {}
async with httpx.AsyncClient(timeout=7200.0) as client:
r = await client.post(f"{TOOLS}/export-intel/sync/places", json=body)
return r.json()
@router.get("/api/export-intel/sync/status")
async def api_sync_status():
return await _proxy("GET", "/sync/status")
@router.post("/api/export-intel/sync/{kind}")
async def api_sync(kind: str, request: Request):
body = {}
@@ -284,7 +317,7 @@ async def api_sync(kind: str, request: Request):
body = await request.json()
except Exception:
body = {}
if kind not in ("contacts", "caterers", "distributors", "customers", "tenders", "all", "world", "region"):
if kind not in ("contacts", "caterers", "distributors", "customers", "tenders", "all", "world", "region", "missing", "places"):
return {"error": "unknown sync kind"}
timeout = 7200.0 if kind in ("world", "region", "all") else 600.0
async with httpx.AsyncClient(timeout=timeout) as client:
+2 -1
View File
@@ -406,6 +406,7 @@ def llm_presets() -> dict[str, Any]:
@settings_router.get("/llm")
def llm_list() -> dict[str, Any]:
llm_router.ensure_openrouter_placeholder()
items = llm_router.list_providers()
default = next((i for i in items if i.get("is_default")), items[0] if items else None)
return {"providers": items, "default": default, "presets": llm_router.list_presets()}
@@ -415,7 +416,7 @@ def llm_list() -> dict[str, Any]:
def llm_create(body: LlmProviderBody) -> dict[str, Any]:
preset = llm_router.LLM_PRESETS.get(body.provider_type, {})
base_url = (body.api_base_url or preset.get("api_base_url") or "").strip() or None
model = body.model or (preset.get("models") or ["deepseek-chat"])[0]
model = body.model or preset.get("default_model") or (preset.get("models") or ["deepseek-chat"])[0]
if body.is_default:
execute("UPDATE llm_providers SET is_default = FALSE, updated_at = NOW()")
row = fetch_one(