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: add azureOpenAIApiDeploymentName for AzureChatOpenAI constructor #4668

Conversation

SpringMT
Copy link
Contributor

@SpringMT SpringMT commented Mar 8, 2024

Fixes # (issue)

AzureOpenAIEmbeddings and AzureOpenAI can use azureOpenAIApiDeploymentName in constructer however AzureChatOpenAI not.

So, add azureOpenAIApiDeploymentName to AzureChatOpenAI.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 8, 2024
Copy link

vercel bot commented Mar 8, 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 10, 2024 6:27am
langchainjs-docs ✅ Ready (Inspect) Visit Preview Mar 10, 2024 6:27am

@dosubot dosubot bot added the auto:improvement Medium size change to existing code to handle new use-cases label Mar 8, 2024
@@ -256,7 +256,8 @@ export class AzureChatOpenAI
getEnvironmentVariable("AZURE_OPENAI_API_ENDPOINT");
Copy link

Choose a reason for hiding this comment

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

Hey team, I've flagged this PR for your review as it includes changes that explicitly access environment variables using the getEnvironmentVariable function. Please take a look and ensure everything is in order.

Copy link
Collaborator

@jacoblee93 jacoblee93 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 this! Nice catch.

CC @sinedied @sarangan12

@@ -256,7 +256,8 @@ export class AzureChatOpenAI
getEnvironmentVariable("AZURE_OPENAI_API_ENDPOINT");

this.azureOpenAIApiCompletionsDeploymentName =
fields?.azureOpenAIEmbeddingsApiDeploymentName ??
(fields?.azureOpenAIEmbeddingsApiDeploymentName ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this even take into account azureOpenAIEmbeddingsApiDeploymentName? I guess we have to leave it there for backwards compatibility...

Copy link
Contributor Author

@SpringMT SpringMT Mar 10, 2024

Choose a reason for hiding this comment

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

While backward compatibility is important, I'm thinking it might be okay to remove azureOpenAIEmbeddingsApiDeploymentName in chat_models since it seems to confuse users.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a PR for deprecating azureOpenAIEmbeddingsApiDeploymentName .
#4714

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Mar 10, 2024
@jacoblee93 jacoblee93 changed the title feat: add azureOpenAIApiDeploymentName for AzureChatOpenAI constructor azure-openai[patch]: feat: add azureOpenAIApiDeploymentName for AzureChatOpenAI constructor Mar 10, 2024
@jacoblee93
Copy link
Collaborator

Thank you! Sorry for the delay.

@jacoblee93 jacoblee93 merged commit 0a63be8 into langchain-ai:main Mar 12, 2024
17 checks passed
@SpringMT SpringMT deleted the feature/add-azureOpenAIApiDeploymentName-for-chat_models branch March 12, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases lgtm PRs that are ready to be merged as-is size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants