google / google/adk-python

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

Đang mở
#5,700 4 bình luận 0 reaction 1 người được giao Được giao cho @polong-lin Xem trên GitHub
documentation needs review
Ngôn ngữ chính
Python
Star
21.5k
Fork
4k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
31

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.