Skip to content

Commit 9baa8d9

Browse files
authored
backporting fix to agents 0.x to ignore Gemini LLM responses with no candidates (#2898)
1 parent 89a2ac2 commit 9baa8d9

File tree

1 file changed

+2
-5
lines changed
  • livekit-plugins/livekit-plugins-google/livekit/plugins/google

1 file changed

+2
-5
lines changed

livekit-plugins/livekit-plugins-google/livekit/plugins/google/llm.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,8 @@ async def _run(self) -> None:
300300
or not response.candidates[0].content
301301
or not response.candidates[0].content.parts
302302
):
303-
raise APIStatusError(
304-
"No candidates in the response",
305-
retryable=True,
306-
request_id=request_id,
307-
)
303+
logger.warning(f"no candidates in the response: {response}")
304+
continue
308305

309306
if len(response.candidates) > 1:
310307
logger.warning(

0 commit comments

Comments
 (0)