Location: Google Developers Blog - ADK Post
Description:
In the "Building a multi-agent application" section of the blog post, the sample code for the root_agent contains a configuration error. The behavioral instructions, delegation rules, and tool usage guidelines are currently assigned to the description parameter.
In the ADK framework, the description is metadata used by the orchestrator for delegation routing, whereas the instruction acts as the System Prompt. By placing the logic in description, the agent is not provided with its operational guidelines during its execution cycle.
Current Code Snippet (from blog):
Python
root_agent = Agent(
name="weather_agent_v2",
model="gemini-2.0-flash-exp",
description="You are the main Weather Agent, coordinating a team. - Your main task: Provide weather using the get_weather tool. Handle its 'status' response ('report' or 'error_message'). - Delegation Rules: - If the user gives a simple greeting (like 'Hi', 'Hello'), delegate to greeting_agent. - If the user gives a simple farewell (like 'Bye', 'See you'), delegate to farewell_agent. - Handle weather requests yourself using get_weather. - For other queries, state clearly if you cannot handle them.",
tools=[get_weather],
sub_agents=[greeting_agent, farewell_agent]
)
Recommended Fix:
The behavioral text should be moved to the instruction parameter, leaving a concise summary for the description.
Python
root_agent = Agent(
name="weather_agent_v2",
model="gemini-2.0-flash-exp",
description="Main coordinator agent for weather services, greetings, and farewells.",
instruction=(
"You are the main Weather Agent. Coordinate your team as follows: "
"1. For 'Hi/Hello', delegate to greeting_agent. "
"2. For 'Bye/See you', delegate to farewell_agent. "
"3. For weather requests, use the get_weather tool. "
"4. If you cannot handle a query, state it clearly."
),
tools=[get_weather],
sub_agents=[greeting_agent, farewell_agent]
)
Location: Google Developers Blog - ADK Post
Description:
In the "Building a multi-agent application" section of the blog post, the sample code for the root_agent contains a configuration error. The behavioral instructions, delegation rules, and tool usage guidelines are currently assigned to the description parameter.
In the ADK framework, the description is metadata used by the orchestrator for delegation routing, whereas the instruction acts as the System Prompt. By placing the logic in description, the agent is not provided with its operational guidelines during its execution cycle.
Current Code Snippet (from blog):
Python
root_agent = Agent(
name="weather_agent_v2",
model="gemini-2.0-flash-exp",
description="You are the main Weather Agent, coordinating a team. - Your main task: Provide weather using the
get_weathertool. Handle its 'status' response ('report' or 'error_message'). - Delegation Rules: - If the user gives a simple greeting (like 'Hi', 'Hello'), delegate togreeting_agent. - If the user gives a simple farewell (like 'Bye', 'See you'), delegate tofarewell_agent. - Handle weather requests yourself usingget_weather. - For other queries, state clearly if you cannot handle them.",tools=[get_weather],
sub_agents=[greeting_agent, farewell_agent]
)
Recommended Fix:
The behavioral text should be moved to the instruction parameter, leaving a concise summary for the description.
Python
root_agent = Agent(
name="weather_agent_v2",
model="gemini-2.0-flash-exp",
description="Main coordinator agent for weather services, greetings, and farewells.",
instruction=(
"You are the main Weather Agent. Coordinate your team as follows: "
"1. For 'Hi/Hello', delegate to greeting_agent. "
"2. For 'Bye/See you', delegate to farewell_agent. "
"3. For weather requests, use the get_weather tool. "
"4. If you cannot handle a query, state it clearly."
),
tools=[get_weather],
sub_agents=[greeting_agent, farewell_agent]
)