-
Notifications
You must be signed in to change notification settings - Fork 4
Update openai package to 2.4.0 and fix breaking changes #181
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
Conversation
Co-authored-by: lilyydu <[email protected]>
Co-authored-by: lilyydu <[email protected]>
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.
Pull Request Overview
This PR updates the OpenAI Python package from version 1.102.0 to 2.4.0 and addresses breaking changes in the API, specifically the replacement of NOT_GIVEN with omit as the sentinel value for optional parameters.
- Updated OpenAI dependency version requirement in pyproject.toml
- Replaced all instances of
NOT_GIVENimports and usage withomitacross the codebase - Updated test assertions to check for
Omittype instead ofNOT_GIVENvalue
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/openai/pyproject.toml | Updated OpenAI dependency from >=1.102.0 to >=2.4.0 |
| packages/openai/src/microsoft/teams/openai/completions_model.py | Replaced NOT_GIVEN import with omit and updated tools parameter handling |
| packages/openai/src/microsoft/teams/openai/responses_chat_model.py | Replaced NOT_GIVEN import with omit and updated tools/instructions parameter handling |
| packages/openai/tests/test_openai_completions_model.py | Updated test assertion to check for Omit type instead of NOT_GIVEN value |
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.
awesome!! 🔥
|
@copilot Nice job |
|
Waiting on a manual sanity check before we merge |
|
verified on devtools with our local ai-test sample 👍🏻 |
Problem
The repository was using openai version 1.102.0, but the latest version is 2.4.0. The update introduced a breaking change in how optional parameters are passed to the OpenAI API, causing type checking failures.
Changes
This PR updates the openai package from 1.102.0 to 2.4.0 and addresses the breaking change where the sentinel value for optional parameters changed from
NOT_GIVENtoomit.Modified Files
packages/openai/pyproject.tomlopenai>=1.102.0→openai>=2.4.0packages/openai/src/microsoft/teams/openai/completions_model.pyNOT_GIVENimport withomitpackages/openai/src/microsoft/teams/openai/responses_chat_model.pyNOT_GIVENimport withomitpackages/openai/tests/test_openai_completions_model.pyOmittype instead ofNOT_GIVENBreaking Change Details
OpenAI 2.4.0 replaced
NOT_GIVENwithomitas the sentinel value for optional parameters:This change affects how optional parameters are passed to OpenAI API endpoints, ensuring proper type compatibility with the new API.
Validation
Related
Fixes the issue reported in feat: add a2a server and client plugins and samples where CI failed due to type incompatibilities after attempting to update the openai package.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
login.microsoftonline.com/home/REDACTED/work/teams.py/teams.py/.venv/bin/python /home/REDACTED/work/teams.py/teams.py/.venv/bin/pytest packages -v --tb=short(dns block)token.botframework.com/home/REDACTED/work/teams.py/teams.py/.venv/bin/python /home/REDACTED/work/teams.py/teams.py/.venv/bin/pytest packages -v --tb=short(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.