Skip to content

Commit d0f4948

Browse files
committed
fix(agent_tool): handle case when last_content.parts are unavailable
1 parent 0094eea commit d0f4948

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/google/adk/tools/agent_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async def run_async(
186186
# to avoid "Attempted to exit cancel scope in a different task" errors
187187
await runner.close()
188188

189-
if not last_content:
189+
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)
192192
if isinstance(self.agent, LlmAgent) and self.agent.output_schema:

0 commit comments

Comments
 (0)