fix: fix multi-round issue

This commit is contained in:
He Tao
2025-04-21 20:16:08 +08:00
parent 8129765105
commit 52313b2405
4 changed files with 12 additions and 4 deletions

View File

@@ -199,6 +199,7 @@ def _execute_agent_step(
) -> Command[Literal["research_team"]]:
"""Helper function to execute a step using the specified agent."""
current_plan = state.get("current_plan")
observations = state.get("observations", [])
# Find the first unexecuted step
for step in current_plan.steps:
@@ -244,7 +245,7 @@ def _execute_agent_step(
name=agent_name,
)
],
"observations": [response_content],
"observations": observations + [response_content],
},
goto="research_team",
)

View File

@@ -14,7 +14,7 @@ class State(MessagesState):
# Runtime Variables
locale: str = "en-US"
observations: Annotated[list[str], operator.add] = []
observations: list[str] = []
plan_iterations: int = 0
current_plan: Plan | str = None
final_report: str = ""