Replies: 4 comments 1 reply
-
| Hey @umairrkhn did you find a workaround for this? I have tried a lot of options and nothing seems to work. |
Beta Was this translation helpful? Give feedback.
-
| You can use a callback before or after to solve this, you could provide more details so we can understand better. |
Beta Was this translation helpful? Give feedback.
-
| @umairrkhn you can consider whether the pattern used inside AgentTool is useful for this. It will default to running the agent as a tool, with its own Runner and temporary session, and wait for the final event until releasing control back to the parent agent event loop. See https://github.com/google/adk-python/blob/main/src/google/adk/tools/agent_tool.py#L129 |
Beta Was this translation helpful? Give feedback.
-
This works thanks, solution use SequentialAgent as AgentTools: from google.adk.agents import SequentialAgent event_announcement_agent = SequentialAgent( name="event_announcement_agent", sub_agents=[event_planner_agent, event_communications_agent], description="A workflow that first plans an event and then sends out announcements.", ) # use SequentialAgent as AgentTool ==> from google.adk.tools.agent_tool import AgentTool guest_list_manager_tool = AgentTool(agent=guest_management_agent) event_announcement_tool = AgentTool(agent=event_announcement_agent) # ==> set as tools root_orchestrator_agent = Agent( name="root_orchestrator_agent", model="gemini-2.5-flash", description="The main orchestrator that delegates tasks to specialist agents for event planning and guest management.", instruction=""" You are the root orchestrator managing an ongoing conversation. Your job is to understand the full context of the user's request and delegate it to the correct specialist tool. - If the user wants to plan an event, find venues, or create a schedule, and then send email announcements use the `event_announcement_tool`. - If the user wants to add, view, or manage guests, use the `guest_list_manager_tool`. Do not try to answer the user's query directly. Always delegate to the appropriate tool. Do not summarize responses from the tools. """, tools=[event_announcement_tool, guest_list_manager_tool] )It is really not clear in the documentation on how to use SequentialAgent but I think AgentTool works much better instead of adding SequentialAgent as sub_agent: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to hide or suppress the output of a specific sub-agent in the UI, when it’s part of a SequentialAgent workflow? I want the sub-agent to run (for its side effects), but not display its output to the user. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions