Fix incorrect import path for AzureAIChatCompletionsModel (#30417)

Fixes #30416

Correct the import path for `AzureAIChatCompletionsModel` in the
`_init_chat_model_helper` function.

* Update the import statement in
`libs/langchain/langchain/chat_models/base.py` to `from
langchain_azure_ai.chat_models import AzureAIChatCompletionsModel`.

---

For more details, open the [Copilot Workspace
session](https://copilot-workspace.githubnext.com/langchain-ai/langchain/pull/30417?shareId=6ff6d5de-e3d1-4972-8d24-5e74838e9945).
This commit is contained in:
Cesar Sanz 2025-03-22 12:44:51 +01:00 committed by GitHub
parent 7750ad588b
commit 5383abfeee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,7 +108,7 @@ def init_chat_model(
- 'openai' -> langchain-openai
- 'anthropic' -> langchain-anthropic
- 'azure_openai' -> langchain-openai
- 'azure_ai -> langchain-ai
- 'azure_ai' -> langchain-azure-ai
- 'google_vertexai' -> langchain-google-vertexai
- 'google_genai' -> langchain-google-genai
- 'bedrock' -> langchain-aws
@ -359,7 +359,7 @@ def _init_chat_model_helper(
return AzureChatOpenAI(model=model, **kwargs)
elif model_provider == "azure_ai":
_check_pkg("langchain_azure_ai")
from langchain_azure_ai import AzureAIChatCompletionsModel
from langchain_azure_ai.chat_models import AzureAIChatCompletionsModel
return AzureAIChatCompletionsModel(model=model, **kwargs)
elif model_provider == "cohere":