Skip to content

fix: a minimal fix for json format mismatch in workforce #2038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion camel/societies/workforce/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{child_nodes_info}
==============================

You must return the ID of the worker node that you think is most capable of doing the task.
You must return the ID of the worker node that you think is most capable of doing the task, i.e. {{'assignee_id': '<ID>'}} (The <ID> is a string).
"""
)

Expand Down
2 changes: 1 addition & 1 deletion camel/societies/workforce/workforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def _find_assignee(
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

Expand Down
Loading