fix: Filter out thought parts when saving agent output to state

PiperOrigin-RevId: 806478056
This commit is contained in:
Google Team Member
2025-09-12 17:04:51 -07:00
committed by Copybara-Service
parent 4c00b86e33
commit bb148002f8
+3 -1
View File
@@ -462,7 +462,9 @@ class LlmAgent(BaseAgent):
):
result = ''.join(
[part.text if part.text else '' for part in event.content.parts]
part.text
for part in event.content.parts
if part.text and not part.thought
)
if self.output_schema:
# If the result from the final chunk is just whitespace or empty,