google / google/adk-python

Documentation Bug: root_agent logic placed in description instead of instruction in ADK Blog Post

未关闭
#5,700 4 条评论 0 个 reaction 已指派 1 人 已指派给 @polong-lin 在 GitHub 查看
documentation needs review
主要语言
Python
星标
21.5k
派生
4k
平均合并
1 天 22 小时
30 天内合并 PR
31

描述

**Location**: [Google Developers Blog - ADK Post](https://developers.googleblog.com/en/agent-development-kit-easy-to-build-multi-agent-applications/)

**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]
)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。