-
Notifications
You must be signed in to change notification settings - Fork 883
Python: fix: GroupChat ManagerSelectionResponse JSON Schema for OpenAI Structured Outpu… #2750
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
Python: fix: GroupChat ManagerSelectionResponse JSON Schema for OpenAI Structured Outpu… #2750
Conversation
|
The fact that
|
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
|
Thanks for working on this, @q33566. Can you please make sure you install the pre-commit hooks that run while committing the code to your branch? See the following: https://github.com/microsoft/agent-framework/blob/main/python/DEV_SETUP.md#after-installing-uv uv run poe pre-commit-install |
e52790b to
a294911
Compare
|
Hi @moonbox3, thank you very much for the guidance. I’ve installed the pre-commit hooks and committed the change, so everything should be working now. Here are the pre-commit check results (previously it failed at |
moonbox3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks again.
…t Strict Mode
Environmental
Motivation and Context
OpenAI's structured output strict mode has a specific requirement: all properties in the JSON Schema must be listed in the required array, even if they have default values.
Previously, ManagerSelectionResponse(in
packages/core/agent_framework/_workflows/_group_chat.py) fields had default value.the schema look like this. (No required array)
Solution Proposed
Now, if we change model_config into this
then print
We can have required array in the schema, which solve the problem
Unit Test Result
cd packages/coreuv run poe testTest Result (All Pass)