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

support azure assistant api #1616

Merged
merged 9 commits into from
Feb 15, 2024
Merged

Conversation

IANTHEREAL
Copy link
Collaborator

@IANTHEREAL IANTHEREAL commented Feb 10, 2024

Why are these changes needed?

while using azure gpt assistant api, model in config_list would cause error: NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}.

Following the azure tutorial - https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant#create-an-assistant, we should remove model from config_list

Related issue number

Checks

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2024

Codecov Report

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

Comparison is base (cff9ca9) 39.44% compared to head (6fbe3b0) 65.07%.

Files Patch % Lines
autogen/agentchat/contrib/gpt_assistant_agent.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1616       +/-   ##
===========================================
+ Coverage   39.44%   65.07%   +25.62%     
===========================================
  Files          56       56               
  Lines        5985     5990        +5     
  Branches     1333     1451      +118     
===========================================
+ Hits         2361     3898     +1537     
+ Misses       3431     1742     -1689     
- Partials      193      350      +157     
Flag Coverage Δ
unittests 64.85% <83.33%> (+25.40%) ⬆️

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.

@IANTHEREAL
Copy link
Collaborator Author

@sonichi @gagb Hi, how should I add a azure assistant api testing? It requires an azure openai account.

@sonichi sonichi added the openai-assistant Issues related to assistants from OpenAI label Feb 10, 2024
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.

I made a few suggestions for future PR.
cc @gagb @olgavrou @ekzhu @BeibinLi @randombet @kinfey

For testing on GitHub, you can use config_list_from_json and add "api_type": ["2024-02-15-preview"] into the filter_dict.

autogen/agentchat/contrib/gpt_assistant_agent.py Outdated Show resolved Hide resolved
@IANTHEREAL
Copy link
Collaborator Author

For testing on GitHub, you can use config_list_from_json and add "api_type": ["2024-02-15-preview"] into the filter_dict.

Ok. I'll see how to run the same test code twice using both OpenAI and Azure API separately.

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.

There is some problem. When users provide the model in the llm_config, it will be ignored.
Prior to this PR, when the model is provided in config_list, it will be ignored. Neither is comprehensive.
We can fix this issue later.

@sonichi sonichi added this pull request to the merge queue Feb 15, 2024
Merged via the queue into microsoft:main with commit b270a2e Feb 15, 2024
53 of 57 checks passed
@gagb
Copy link
Collaborator

gagb commented Feb 15, 2024

@gagb can you give it a try? I just fixed the code, I got the parameters of OpenAIWrapper wrong

Btw I did test it today. It worked with openai assistants, but I got stuck at trying to find an azure key that supported assistant API. The one I had access to did not :( I am working on getting it

whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* support azure assistant api

* try to add azure testing

* improve testing

* fix testing

* fix code

---------

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
openai-assistant Issues related to assistants from OpenAI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Microsoft Azure OpenAI Service Assistant API Support
5 participants