🐫 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: a minimal fix for json format mismatch in workforce (#2038)
Chen8931e6244f7c
diff --git a/camel/societies/workforce/prompts.py b/camel/societies/workforce/prompts.pyindex 72e0dffb2..dce5f2072 100644--- a/camel/societies/workforce/prompts.py+++ b/camel/societies/workforce/prompts.py@@ -67,6 +67,7 @@ Following is the information of the existing worker nodes. The format is <ID>:<d{child_nodes_info}==============================+You must return the ID of the worker node that you think is most capable of doing the task.Your response MUST be a valid JSON object containing a single field: 'assignee_id' (a string with the chosen worker node ID).diff --git a/camel/societies/workforce/workforce.py b/camel/societies/workforce/workforce.pyindex db77692c9..4a9018c97 100644--- a/camel/societies/workforce/workforce.py+++ b/camel/societies/workforce/workforce.py@@ -308,7 +308,7 @@ class Workforce(BaseNode):response = self.coordinator_agent.step(prompt, response_format=TaskAssignResult)- result_dict = json.loads(response.msg.content)+ result_dict = json.loads(response.msg.content, parse_int=str)task_assign_result = TaskAssignResult(**result_dict)return task_assign_result.assignee_id