将工具选择从 ToolChoice.REQUIRED 更新为 ToolChoice.AUTO,以优化规划代理和规划流程的工具调用逻辑。

This commit is contained in:
xRay 2025-03-14 09:46:46 +08:00
parent be5c2646af
commit 89c9d904db
2 changed files with 2 additions and 2 deletions

View File

@ -212,7 +212,7 @@ class PlanningAgent(ToolCallAgent):
messages=messages, messages=messages,
system_msgs=[Message.system_message(self.system_prompt)], system_msgs=[Message.system_message(self.system_prompt)],
tools=self.available_tools.to_params(), tools=self.available_tools.to_params(),
tool_choice=ToolChoice.REQUIRED, tool_choice=ToolChoice.AUTO,
) )
assistant_msg = Message.from_tool_calls( assistant_msg = Message.from_tool_calls(
content=response.content, tool_calls=response.tool_calls content=response.content, tool_calls=response.tool_calls

View File

@ -124,7 +124,7 @@ class PlanningFlow(BaseFlow):
messages=[user_message], messages=[user_message],
system_msgs=[system_message], system_msgs=[system_message],
tools=[self.planning_tool.to_param()], tools=[self.planning_tool.to_param()],
tool_choice=ToolChoice.REQUIRED, tool_choice=ToolChoice.AUTO,
) )
# Process tool calls if present # Process tool calls if present