Skip to content

Conversation

@waundme
Copy link

@waundme waundme commented May 14, 2023

What does this PR do?

Implements a new class AzureOpenAiAgent derived from Agent in transformer agents.

Fixes #23324

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

@waundme waundme marked this pull request as ready for review May 14, 2023 11:09
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@MSDNAndi
Copy link

Awesome that you are contributing.
In my opinion, rather than having a separate AzureOpenAiAgent adding the options and API calls in the OpenAiAgent would be preferrable, so it is only configuration of parameters to switch to Azure. Not my call, but my preference.

@amyeroberts
Copy link
Contributor

cc @sgugger

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. This is exactly like the OpenAiAgent class execpt for two new arguments (is_chat_model is not useful since we can determine this from the model ID) so the arguments should just be added to OpenAiAgent as optionals.

@sgugger
Copy link
Collaborator

sgugger commented May 16, 2023

Ah actually I see two arguments are renamed. Maybe have this be a subclass of OpenAiAgent to avoid rewriting every method and just rewrites _completion_generate and _chat_generate?

@MSDNAndi
Copy link

DeploymentId is named arbitrarily and does not let you directly derive the model type from it unless you do additional requests to look it up.
The underlying Python OpenAI SDK has a way of differentiating between Azure OpenAI and OpenAI's own deployment. In my opinion it would make sense to align the API style and expose what the API exposes in a similar fashion.

@sgugger
Copy link
Collaborator

sgugger commented May 16, 2023

The underlying Python OpenAI SDK has a way of differentiating between Azure OpenAI and OpenAI's own deployment. In my opinion it would make sense to align the API style and expose what the API exposes in a similar fashion.

If it's easily doable, then yes let's aim for that!

@sgugger sgugger mentioned this pull request Jun 6, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this Jun 22, 2023
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.

Support Azure OpenAI in transformer agents

5 participants