debug(llm): показать HTTP-версию в ошибке

This commit is contained in:
2026-06-14 07:51:06 +04:00
parent 8cb7139924
commit 14c8984ed2
+2 -1
View File
@@ -63,7 +63,8 @@ def ask(prompt: str, model: str = None, max_tokens: int = 8000) -> dict:
}
except httpx.HTTPStatusError as e:
return {"error": f"LLM HTTP {e.response.status_code}: {e.response.text[:500]}"}
http_ver = e.response.http_version if hasattr(e.response, 'http_version') else '?'
return {"error": f"LLM HTTP {e.response.status_code} (HTTP/{http_ver}): {e.response.text[:500]}"}
except httpx.TimeoutException:
return {"error": "LLM timeout"}
except Exception as e: