Merge pull request #603 from raydoomed/main

将工具选择从 ToolChoice.REQUIRED 更新为 ToolChoice.AUTO,以优化规划代理和规划流程的工具调用逻辑。
This commit is contained in:
mannaandpoem 2025-03-14 11:21:02 +08:00 committed by GitHub
commit a1b5d189db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

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

View File

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