Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

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

cthomas3e17b4289a06
diff --git a/letta/interfaces/gemini_streaming_interface.py b/letta/interfaces/gemini_streaming_interface.py
index b493f475f..fa270199b 100644
--- a/letta/interfaces/gemini_streaming_interface.py
+++ b/letta/interfaces/gemini_streaming_interface.py
@@ -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: