google / google/adk-python

关于多agent中,子agent参数planner=PlanReActPlanner()的问题

Open
#4,739 5 comments 0 reactions 1 assignee Assigned to @GWeale View on GitHub
core needs review
Dominant language
Python
Stars
21.5k
Forks
4k
Avg merge
1d 14h
Merged PRs (30d)
37

Description

## 🔴 Required Information
*Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A*

**Describe the Bug:**
多agent中,子agent使用planner=PlanReActPlanner()参数,agent调用tools=[FunctionTool(tool_rag_qa)] tool_rag_qa是rag检索, 这个tool的作用就是调用rag,在几轮对话以后,就返回内容为空,模型没有输出

**Steps to Reproduce:**
Please provide a numbered list of steps to reproduce the behavior:
1. Install 'google-adk'
2. test 'adk web'
不设置planner=PlanReActPlanner(),多轮对话正常,多少轮都没事
设置planner=PlanReActPlanner(),多轮对话,几轮之后模型返回值为空

**Expected Behavior:**
可以在多agent中,子agent可以正常进行多轮对话

**Observed Behavior:**
无报错

**Environment Details:**

- pip install adk=1.25.1
- ubuntu 22/04
- Python 12

**Model Information:**

- Are you using LiteLLM: Yes
- Which model is being used: deepseek

---

## 🟡 Optional Information
*Providing this information greatly speeds up the resolution process.*

**Regression:** adk web
例子:
/REASONING/ 根据工具返回的信息,我获得了高血压分级标准。现在我可以按照约束2的要求,对用户血压145/95mmHg进行分级评估。

收缩压145mmHg属于140~159mmHg范围
舒张压95mmHg属于90~99mmHg范围
现在我需要按照约束2的格式输出分级结果。

/FINAL_ANSWER/

返回的state是模型总结的信息

几轮之后,在进行对话,可以正确思考并且调用tool,但是返回的state是空字符串,无报错。

**Minimal Reproduction Code:**

agent_health_education = None
try:
agent_health_education = Agent(
model=model_default,
planner=PlanReActPlanner(),
name="agent_health_education",
instruction=prompt.INSTRUCTION_EDUCATION,
description="负责对用户提出的高血压问题进行解答、咨询或科普教育。",
#before_model_callback=simple_before_model_modifier,
tools=[FunctionTool(tool_rag_qa)],
output_key="health_education-result",
)
print(f"✅ Agent '{agent_health_education.name}'.")
except Exception as e:
print(f"❌ Could not create agent '{agent_health_education.name}'. Error: {e}")

**How often has this issue occurred?:**

- Always (100%)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.