Skip to content

Commit 87fca92

Browse files
committed
fix(agent_tool): case when merged_text is empty
1 parent d0f4948 commit 87fca92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/google/adk/tools/agent_tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ async def run_async(
189189
if not last_content or not last_content.parts:
190190
return ''
191191
merged_text = '\n'.join(p.text for p in last_content.parts if p.text)
192+
# no text present -> no json, return empty string
193+
if not merged_text:
194+
return ''
192195
if isinstance(self.agent, LlmAgent) and self.agent.output_schema:
193196
tool_result = self.agent.output_schema.model_validate_json(
194197
merged_text

0 commit comments

Comments
 (0)