Use fast non-thinking DeepSeek for stove matching

This commit is contained in:
anor
2026-11-26 22:14:19 +10:00
parent dd93361276
commit 95a8b36ecb
3 changed files with 44 additions and 2 deletions
+5 -2
View File
@@ -91,7 +91,7 @@ def _profile_chain():
quota = zaika_quota.snapshot()
if quota.get("known") and (quota.get("percent_used") or 0) >= 80:
chain = [p for p in chain if p.name != "glm"]
return chain
return sorted(chain, key=lambda profile: profile.name != "deepseek")
async def _call(profile, body: dict, timeout: float) -> tuple[str, dict]:
@@ -128,7 +128,10 @@ async def _ask(batch: list[dict], key_id: int, budget: float, deadline: float, r
started = time.time()
usage = {}
try:
text, usage = await _call(profile, body, max(0.1, min(20, deadline-time.monotonic())))
provider_body = ({**body, "thinking": {"type": "disabled"}}
if profile.name == "deepseek" else body)
text, usage = await _call(profile, provider_body,
max(0.1, min(20, deadline-time.monotonic())))
payload = json.loads(text.strip().removeprefix("```json").removesuffix("```").strip())
if not isinstance(payload, list):
raise ValueError("ответ модели не массив")