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

azure-openai[patch]: feat: use azureOpenAIApiDeploymentName for all azure-openai #4714

Conversation

SpringMT
Copy link
Contributor

@SpringMT SpringMT commented Mar 12, 2024

Fixes # (issue)
Ref #4668

In azure-openai, azureOpenAiembeddingsApiDeploymentName is deprecated in favor of azureOpenAIApiDeploymentName.
This change introduces consistency but at the cost of losing backward compatibility for using azureOpenAIEmbeddingsApiDeploymentName in AzureChatOpenAI.

Copy link

vercel bot commented Mar 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2024 0:32am
langchainjs-docs ✅ Ready (Inspect) Visit Preview Mar 13, 2024 0:32am

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. auto:refactor A large refactor of a feature(s) or restructuring of many files labels Mar 12, 2024
@@ -255,8 +255,8 @@ export class AzureChatOpenAI
Copy link

Choose a reason for hiding this comment

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

Hey there! I noticed that the recent change in the chat_models.ts file explicitly adds, accesses, reads, or requires an environment variable via process.env or getEnvironmentVariable. I've flagged this for your review to ensure it aligns with our environment variable handling practices. Keep up the great work!

@@ -48,11 +48,9 @@ export class AzureOpenAIEmbeddings
Copy link

Choose a reason for hiding this comment

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

Hey there! I've flagged this PR for your review because it includes a change that explicitly accesses an environment variable using the getEnvironmentVariable function. Please take a look and ensure it aligns with our environment variable usage guidelines. Let me know if you have any questions!

getEnvironmentVariable("AZURE_OPENAI_API_DEPLOYMENT_NAME"));
this.azureOpenAIApiDeploymentName =
fieldsWithDefaults?.azureOpenAIApiDeploymentName ??
getEnvironmentVariable("AZURE_OPENAI_API_DEPLOYMENT_NAME");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I actually think we want to keep this env var for embeddings and have it use the current behavior - it's apparently common for completions vs. embeddings endpoints.

Yes let's make the change on the input field name though.

@jacoblee93 jacoblee93 changed the title feat: use azureOpenAIApiDeploymentName for all azure-openai azure-openai[major]: feat: use azureOpenAIApiDeploymentName for all azure-openai Mar 12, 2024
@jacoblee93
Copy link
Collaborator

jacoblee93 commented Mar 12, 2024

Thank you @SpringMT!

CC @sarangan12 @sinedied this is technically breaking but given the naming is very confusing, I think it'd be good to do now.

However, looks like ~6k downloads a week, which is more than 0: https://www.npmjs.com/package/@langchain/azure-openai

What do you think?

@jacoblee93 jacoblee93 added the hold On hold label Mar 12, 2024
@jacoblee93
Copy link
Collaborator

Discussed with some MS folks, I think the preference would be to avoid a breaking change, even though it's early.

I can patch this up later if you'd like.

@SpringMT
Copy link
Contributor Author

Thanks for your offer.
The PR does not neet to merge immediately, so you feel free to address it later when it's more convenient.
Thx!

@jacoblee93
Copy link
Collaborator

Updated to restore backwards compatibility 👍

@jacoblee93 jacoblee93 changed the title azure-openai[major]: feat: use azureOpenAIApiDeploymentName for all azure-openai azure-openai[patch]: feat: use azureOpenAIApiDeploymentName for all azure-openai Mar 13, 2024
@jacoblee93 jacoblee93 added lgtm PRs that are ready to be merged as-is and removed hold On hold labels Mar 13, 2024
@jacoblee93 jacoblee93 merged commit 5154747 into langchain-ai:main Mar 13, 2024
17 checks passed
@jacoblee93
Copy link
Collaborator

Thank you!

@SpringMT SpringMT deleted the feature/use-azureOpenAIApiDeploymentName-for-azure-openai branch March 13, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:refactor A large refactor of a feature(s) or restructuring of many files lgtm PRs that are ready to be merged as-is size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants