Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The recommended approach is to use Hello @amisev, Thank you for the detailed question. This is a great question about the idiomatic way to handle parameter passing in the "agent-as-a-tool" pattern. Recommended Approach: Using
|
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The recommended and most robust approach is option A: Hello! That's an excellent question about a common and powerful pattern in ADK: using one agent as a tool for another. Recommended Approach:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello ADK Team,
I'm looking for guidance on the best practice for passing initial parameters from a root LLMAgent to a SequentialAgent that is being used as a tool.
My setup involves a root LLMAgent that uses AgentTool to delegate tasks to a multi-step SequentialAgent.
When the BarAssistant's LLM generates a tool call for my SequentialAgent, the function call looks like this:
By inspecting the AgentTool's source code, I can see that it takes the string value from args['request'] and wraps it in a types.Content object. This Content object is then passed as the new_message to the Runner that executes the foo_tool_agent.
My question is: What is the official or most idiomatic way for the first sub-agent inside FooTool to access this initial request string ("{"param1": "valueA", "param2": 123}")?
I see a few potential ways to access this data from the ctx object within my sub-agent's _run_async_impl method:
A) From ctx.user_content: Should I access the raw message directly?
B) From the Session Events List: Should I parse the last event from the session history?
I would appreciate any clarity on the recommended approach for this common agent-as-a-tool pattern. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions