🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: `ChatAgent` tool calling issue with `single_iteration=True` (#2105)
Ziyi Yangc396ea764f37
diff --git a/camel/agents/chat_agent.py b/camel/agents/chat_agent.pyindex 38b98b4e1..020ae8bc3 100644--- a/camel/agents/chat_agent.py+++ b/camel/agents/chat_agent.py@@ -603,9 +603,6 @@ class ChatAgent(BaseAgent):self._get_full_tool_schemas(),)- if self.single_iteration:- break-if tool_call_requests := response.tool_call_requests:# Process all tool callsfor tool_call_request in tool_call_requests:@@ -625,6 +622,9 @@ class ChatAgent(BaseAgent):if external_tool_call_requests:break+ if self.single_iteration:+ break+# If we're still here, continue the loopcontinue@@ -695,9 +695,6 @@ class ChatAgent(BaseAgent):self._get_full_tool_schemas(),)- if self.single_iteration:- break-if tool_call_requests := response.tool_call_requests:# Process all tool callsfor tool_call_request in tool_call_requests:@@ -718,6 +715,9 @@ class ChatAgent(BaseAgent):if external_tool_call_requests:break+ if self.single_iteration:+ break+# If we're still here, continue the loopcontinue