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

Handle azure_deployment Parameter Issue in GPTAssistantAgent to Maintain Compatibility with OpenAIWrapper #1721

Merged
merged 8 commits into from
Feb 24, 2024

Conversation

IANTHEREAL
Copy link
Collaborator

Why are these changes needed?

context

The GPTAssistantAgent supports an optional azure_deployment parameter, which, when specified during the initialization of the AzureOpenAI client, leads to a NotFoundError with error code 404 on calling client.beta.assistants.list():

openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

Omitting the azure_deployment parameter results in normal operation. This behavior is incompatible with the implementation logic of OpenAIWrapper and implies a potential deficiency in the AzureOpenAI implementation(openai/openai-python#1163).

Notably, GPTAssistantAgent requires the model/azure_deployment to be specified only when calling client.beta.assistants.create.

To circumvent this issue without affecting the existing logic of other agents and before a fix is released for the openai python library, we should locally handle the azure_deployment parameter within GPTAssistantAgent.

What to do in this PR?

The PR addresses the comprehensive handling of llm config issues outlined in #1688.

Related issue number

Closes #1688

Checks

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (2750391) 39.33% compared to head (13356a9) 51.17%.
Report is 2 commits behind head on main.

Files Patch % Lines
autogen/agentchat/contrib/gpt_assistant_agent.py 9.09% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1721       +/-   ##
===========================================
+ Coverage   39.33%   51.17%   +11.83%     
===========================================
  Files          57       57               
  Lines        6096     6097        +1     
  Branches     1365     1482      +117     
===========================================
+ Hits         2398     3120      +722     
+ Misses       3502     2729      -773     
- Partials      196      248       +52     
Flag Coverage Δ
unittests 51.09% <9.09%> (+11.75%) ⬆️

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.

Copy link
Contributor

@sonichi sonichi left a comment

Choose a reason for hiding this comment

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

@qingyun-wu please don't run the openai contrib test until the logging of api_keys etc. is removed.

autogen/agentchat/contrib/gpt_assistant_agent.py Outdated Show resolved Hide resolved
@sonichi sonichi added this pull request to the merge queue Feb 24, 2024
Merged via the queue into microsoft:main with commit fb2b412 Feb 24, 2024
53 of 57 checks passed
thinkall pushed a commit that referenced this pull request Feb 24, 2024
…ain Compatibility with OpenAIWrapper (#1721)

* support getting model from both llm config and config list

* address comments

* address commentsd

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
@IANTHEREAL IANTHEREAL deleted the fix-gpt-assistant-model branch February 26, 2024 01:16
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
…ain Compatibility with OpenAIWrapper (microsoft#1721)

* support getting model from both llm config and config list

* address comments

* address commentsd

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
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] model in GPTAssistant
4 participants