We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a245a0c commit 01f18c6Copy full SHA for 01f18c6
1 file changed
src/balatrollm/llm.py
@@ -88,6 +88,11 @@ async def call(
88
try:
89
response = await self._client.chat.completions.create(**request_data)
90
self._consecutive_timeouts = 0
91
+
92
+ # Guard against API returning empty/None choices
93
+ if not response.choices:
94
+ raise LLMClientError("API returned empty response (no choices)")
95
96
return response
97
98
except openai.APITimeoutError as e:
0 commit comments