Potential problem of Agent-as-a-tool example
https://google.github.io/adk-docs/tools/function-tools/ I follow Agent-as-a-tool code example, and defined 2 agents, and use adk web ui to test it.
# tool agent
summary_agent = Agent(
model="gemini-2.0-flash",
name="summary_agent",
instruction="""You are an expert summarizer. Please read the following text and provide a concise summary.""",
description="Agent to summarize text",
)
root_agent = Agent(
model='gemini-2.0-flash',
name='root_agent',
instruction="""You are a helpful assistant. When the user provides a long text, use the 'summarize' tool to get a summary and then present it to the user.""",
tools=[AgentTool(agent=summary_agent)]
)
Based on the instruction, I will expect the root_agent to pass the long text to the summary_agent, and get the summary there. But from the ui, what I see is a bit different.
Instead of passing the original long text to summary agent, root_agent pass a summary to summary agent, and summary_agent return a summary for that summary. This is unexpected.
And the summary returned seems longer than root agent's input.
Maybe we can play with the instruction to nudge root_agent to pass the user text as it is to the summary agent.
@abhishm I see root_agent's instructions is already updated. It works for gemini now, but is not very stable for other local LLMs. Thanks!
I'm closing this as it works for Gemini. Not all local LLMs have the same ability to follow instructions, especially small LLMs. You may want to adjust the instructions for them or use other techniques.