Skip to content

Switched to AzureOpenAI for api_type=="azure"#1232

Merged
sonichi merged 16 commits into
microsoft:mainfrom
maxim-saplin:AzureOpenAI
Jan 17, 2024
Merged

Switched to AzureOpenAI for api_type=="azure"#1232
sonichi merged 16 commits into
microsoft:mainfrom
maxim-saplin:AzureOpenAI

Conversation

@maxim-saplin

Copy link
Copy Markdown
Contributor

With version 1 of openai client library there's a dedicated class AzureOpenAI to handle Azure endpoints. While the current version had a cryptic _process_for_azure workaround likely coming from pre v1 times it makes sense to remove the old code and hand over the responsibility of interacting with Azure straight to openai library/

Checks

@codecov-commenter

codecov-commenter commented Jan 13, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 41.17647% with 10 lines in your changes missing coverage. Please review.

Project coverage is 41.81%. Comparing base (acf81ac) to head (d5caae1).
Report is 1869 commits behind head on main.

Files with missing lines Patch % Lines
autogen/oai/client.py 41.17% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1232      +/-   ##
==========================================
+ Coverage   31.95%   41.81%   +9.85%     
==========================================
  Files          33       33              
  Lines        4431     4415      -16     
  Branches     1035     1085      +50     
==========================================
+ Hits         1416     1846     +430     
+ Misses       2897     2421     -476     
- Partials      118      148      +30     
Flag Coverage Δ
unittests 41.74% <41.17%> (+9.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonichi sonichi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doing this PR right requires some deep understanding of the code. #868 tried it but also didn't succeed. If my comment is hard to understand, please let me know and I can do the PR and make you a reviewer.

Comment thread autogen/oai/client.py
Comment thread autogen/oai/client.py
Comment thread autogen/oai/client.py Outdated
Comment thread autogen/oai/client.py Outdated
@sonichi

sonichi commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Could you fix the conflict? We are close to ready.

@maxim-saplin

Copy link
Copy Markdown
Contributor Author

@sonichi , I had to return the model names workaround to fix tests using get-3.5-instruct, without the fix the tests are not runnable with azure models

image

@sonichi

sonichi commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

@sonichi , I had to return the model names workaround to fix tests using get-3.5-instruct, without the fix the tests are not runnable with azure models

image

Pushed a change that should fix this.

@maxim-saplin

Copy link
Copy Markdown
Contributor Author

Pushed a change that should fix this.

Looks good, tests pass

@yiranwu0 yiranwu0 mentioned this pull request Mar 3, 2024
3 tasks
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.

4 participants