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

Migrate from deprecated @azure/openai package to openai #3050

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

thomasdax98
Copy link
Member

Description

Migrate from deprecated @azure/openai package to openai

see https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/migration-javascript for more info

Acceptance criteria

Screenshots/screencasts

Still works:

Uploading Bildschirmaufnahme 2025-01-08 um 11.41.01.mov…

return new AzureOpenAI({
apiKey: config.apiKey,
deployment: config.deploymentId,
apiVersion: config.apiVersion ?? "2024-03-01-preview",
Copy link
Member Author

Choose a reason for hiding this comment

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

In the new library, apiVersion is a required field. In the old library, it wasn't required and the library had a default (see https://github.com/minhanh-phan/azure-sdk-for-js/blob/39b9c4251908c5eb60964cd8f7706fa2efd5e6b9/sdk/openai/openai/src/rest/openAIClient.ts#L22)

I copied this default and hope that it will continue to work. We can make the field required in v8

@thomasdax98 thomasdax98 marked this pull request as ready for review January 8, 2025 10:51
@auto-assign auto-assign bot requested a review from johnnyomair January 8, 2025 10:51
Copy link

sonarqubecloud bot commented Jan 9, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
34.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@thomasdax98 thomasdax98 merged commit c66a403 into main Jan 10, 2025
12 of 13 checks passed
@thomasdax98 thomasdax98 deleted the update-azure-openai branch January 10, 2025 09:11
stekalt pushed a commit that referenced this pull request Jan 15, 2025
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.

2 participants