Use fast non-thinking DeepSeek for stove matching
This commit is contained in:
+5
-2
@@ -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("ответ модели не массив")
|
||||
|
||||
Reference in New Issue
Block a user