feat: gracefully handle gemini empty content parts (#5116)

This commit is contained in:
cthomas
2025-10-03 11:48:15 -07:00
committed by Caren Thomas
parent 09b173668a
commit 3e17b4289a

View File

@@ -173,6 +173,9 @@ class SimpleGeminiStreamingInterface:
# NOTE: should always be len 1
candidate = event.candidates[0]
if not candidate.content or not candidate.content.parts:
return
for part in candidate.content.parts:
# NOTE: the thought signature often comes after the thought text, eg with the tool call
if part.thought_signature: