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

Add support for Azure OpenAI #42

Merged
merged 5 commits into from
Feb 13, 2024
Merged

Add support for Azure OpenAI #42

merged 5 commits into from
Feb 13, 2024

Conversation

the-gigi
Copy link
Contributor

@the-gigi the-gigi commented Feb 12, 2024

This PR adds support to Azure OpenAI and addresses #3

There are 5 differences between OpenAI and Azure OpenAI. They are all addressed here and the code was tested against an Azure OpenAI deployment.

  1. The base URL is different and unique to each deployment
  2. The API key is passed in a header called api-key
  3. The endpoints path don't include the /v1/ prefix that some OpenAI endpoints use
  4. An API version query param must be added
  5. The model is baked into each deployment and is not passed as part of the request

Here are the details of the PR:

  • Bump celverclient to 1.0.0 (for URL interceptor)
  • Add an optional urlInterceptor function
  • Add header api-key: <API key>
  • Fix some tests that broke due to cleverclient 1.0.0 removing HttpProcessor constructor (replace with builder)
  • Add new AzureOpenAIChatServiceDemo
  • Tested the demo against an Azure OpenAI deployment

@the-gigi the-gigi changed the title Add support for AzureOpen AI Add support for Azure OpenAI Feb 12, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9ca56a2) 88.09% compared to head (7eaadac) 88.08%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #42      +/-   ##
============================================
- Coverage     88.09%   88.08%   -0.02%     
  Complexity      602      602              
============================================
  Files           105      105              
  Lines           941      940       -1     
  Branches         27       27              
============================================
- Hits            829      828       -1     
  Misses           69       69              
  Partials         43       43              

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

Copy link
Owner

@sashirestela sashirestela left a comment

Choose a reason for hiding this comment

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

@the-gigi Please, fix the observations

@sashirestela sashirestela linked an issue Feb 13, 2024 that may be closed by this pull request
@sashirestela sashirestela merged commit 443dea1 into sashirestela:main Feb 13, 2024
1 check passed
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.

Azure OpenAI API
3 participants