Skip to content

Commit bb14800

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: Filter out thought parts when saving agent output to state
PiperOrigin-RevId: 806478056
1 parent 4c00b86 commit bb14800

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/google/adk/agents/llm_agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ def __maybe_save_output_to_state(self, event: Event):
462462
):
463463

464464
result = ''.join(
465-
[part.text if part.text else '' for part in event.content.parts]
465+
part.text
466+
for part in event.content.parts
467+
if part.text and not part.thought
466468
)
467469
if self.output_schema:
468470
# If the result from the final chunk is just whitespace or empty,

0 commit comments

Comments
 (0)