Error: “Function transfer_to_agent is not found in the tools_dict” when sub-agent invokes another agent inside LoopAgent #3330
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The error occurs because sub-agents within a Hi @parthiaitech, Thank you for your detailed question. I can clarify why you're seeing this error and suggest the recommended approach for this workflow. Why the Error OccursIn ADK, agent-to-agent communication is hierarchical. An agent is only given the The error "Function transfer_to_agent is not found in the tools_dict" occurs because your How
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I’m experimenting with a multi-agent workflow in Google ADK where a main (supervisor) agent coordinates several sub-agents, including a LoopAgent that handles iterative planning and execution.
Here’s the simplified structure:
loop_agent = LoopAgent(
name="loop_agent",
sub_agents=[planner_agent, executor_agent],
max_iterations=20
)
SupervisorAgent = LlmAgent(
name="supervisor_agent",
model=LiteLlm(model=llm_model),
description="Coordinates and monitors tasks across retrieval_agent, planner_agent, and executor_agent sub-agents.",
instruction=instruction,
sub_agents=[retrieval_agent, loop_agent],
before_model_callback=simple_before_model_modifier,
after_model_callback=simple_after_model_modifier,
generate_content_config=types.GenerateContentConfig(temperature=0.1),
)
When the planner sub-agent inside the loop_agent tries to invoke the executor sub-agent, I receive the following error:
"error": "Function transfer_to_agent is not found in the tools_dict."
It seems like the function or tool mapping between sub-agents within the LoopAgent isn’t being recognized.
Question:
Is there a specific way to enable agent-to-agent communication or tool transfer within a LoopAgent?
Do I need to define or register the transfer_to_agent function explicitly for nested sub-agents?
What’s the recommended method to allow one sub-agent inside a LoopAgent to call another sub-agent seamlessly?
Any insights, examples, or configuration guidance would be greatly appreciated!
Thank you,
Beta Was this translation helpful? Give feedback.
All reactions