fix: count reasoning-only liveness responses as healthy
Build and deploy / build-deploy (push) Waiting to run
Build and deploy / build-deploy (push) Waiting to run
This commit is contained in:
+4
-3
@@ -654,10 +654,11 @@ def api_check(model_id: str):
|
||||
# упадёт, реально потраченные токены сохраняются в checks.
|
||||
usage = extract_usage(resp)
|
||||
choice = resp["choices"][0]
|
||||
content = choice["message"].get("content")
|
||||
ok = isinstance(content, str) and bool(content.strip())
|
||||
message = choice["message"]
|
||||
ok = any(isinstance(message.get(field), str) and message[field].strip()
|
||||
for field in ("content", "reasoning_content"))
|
||||
if not ok:
|
||||
error = f"Empty text response (finish_reason={choice.get('finish_reason')})"
|
||||
error = f"Empty content and reasoning (finish_reason={choice.get('finish_reason')})"
|
||||
except Exception as e:
|
||||
error = f"{type(e).__name__}: {e}"
|
||||
print(f"[check] {model_id}: {error}")
|
||||
|
||||
Reference in New Issue
Block a user