google / google/adk-python

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

Abierto
#4,739 5 comentarios 0 reacciones 1 asignado Asignado a @GWeale Ver en GitHub
core needs review
Lenguaje dominante
Python
Estrellas
21.5k
Forks
4k
Merge medio
1 d 14 h
PR fusionados (30 d)
37

Descripción

## 🔴 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%)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.