Skip to content
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

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

cafeii
Copy link
Collaborator

@cafeii cafeii commented Mar 29, 2025

Description

A minimal fix for json format mismatch in workforce.

TaskAssignResult requires responses to be in json format, while the old task assignment prompt did not enforce a json format output.

To address this, an additional instruction has been appended to the prompt, instructing the task assigner to provide the task assignment result in json.

TaskAssignResult expects assignee_id to be a str, but by default json.loads converts numeric strings (e.g., "123") into int (e.g., 123). To prevent this, modify the code to use json.loads(parse_int=str).

Fixes #1731

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

Copy link
Collaborator

@zjrwtx zjrwtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cafeii ,can we add some fail example to show this problem? not sure if there something other problem

@cafeii
Copy link
Collaborator Author

cafeii commented Apr 1, 2025

thanks @cafeii ,can we add some fail example to show this problem? not sure if there something other problem

sure, but i'm also not quite certain about the fail examples. I met this bug while solving #1731, which is really lack of information. in fact, all three test scripts in workforce (hackathon_judges.py, multiple_single_agents.py, role_playing_with_agents.py) cannot run successfully due to the json format bug while testing locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Issue with Workforce’s support for inference models
3 participants