langchain - ✅(Solved) Fix Upgrade `azure_ai` model provider to not use deprecated classses [1 pull requests, 3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35811Fetched 2026-04-08 00:43:08
View on GitHub
Comments
3
Participants
2
Timeline
15
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×3mentioned ×2subscribed ×2

Fix Action

Fixed

PR fix notes

PR #35812: fix(langchain,langchain-classic): update model provider classes for Azure AI Foundry

Description (problem / solution / changelog)

Fixes #35811

Updates support for the "azure_ai" provider in both chat model and embeddings initialization, ensuring consistency across the codebase and removing the use of deprecated classes AzureAIChatCompletionsModel and AzureAIEmbeddingsModel. The changes primarily involve updating provider mappings and instantiation logic for Azure AI integrations.

Changes:

  • Updated the chat model initialization logic in langchain_classic and langchain_v1 to use AzureAIOpenAIApiChatModel instead of the deprecated AzureAIChatCompletionsModel for the "azure_ai" provider. [1] [2]
  • Added support for the "azure_ai" provider in embeddings initialization, mapping it to the new AzureAIOpenAIApiEmbeddingsModel class in both langchain_classic and langchain_v1. [1] [2] [3]

Changed files

  • libs/langchain/langchain_classic/chat_models/base.py (modified, +3/-3)
  • libs/langchain/langchain_classic/embeddings/base.py (modified, +15/-8)
  • libs/langchain_v1/langchain/chat_models/base.py (modified, +1/-1)
  • libs/langchain_v1/langchain/embeddings/base.py (modified, +3/-1)
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Feature Description

The current implementation of the azure_ai provider in langchain_classic and langchain relies on recently deprecated classes and lacks consistent support across both chat and embeddings modules.

Use Case

Remove reliance on deprecated Azure AI classes and provide a unified initialization experience for Azure AI across different LangChain versions.

Proposed Solution

Proposed Changes

  • Chat Models: Update the initialization logic to use AzureAIOpenAIApiChatModel for the azure_ai provider, replacing the deprecated AzureAIChatCompletionsModel.
  • Embeddings: Implement missing support for the azure_ai provider in embeddings initialization by mapping it to the AzureAIOpenAIApiEmbeddingsModel class.
  • Parity: Ensure these changes are reflected consistently in both langchain_classic and langchain_v1 directories to prevent logic drift.

Alternatives Considered

No response

Additional Context

No response

extent analysis

Fix Plan

To address the deprecation issue and provide a unified initialization experience for Azure AI, follow these steps:

  • Update the azure_ai provider in langchain_classic and langchain to use AzureAIOpenAIApiChatModel for chat models:
    • Replace AzureAIChatCompletionsModel with AzureAIOpenAIApiChatModel in the initialization logic.
  • Implement support for the azure_ai provider in embeddings initialization:
    • Map azure_ai to AzureAIOpenAIApiEmbeddingsModel in the embeddings initialization logic.
  • Ensure consistency across langchain_classic and langchain_v1 directories:
    • Apply the same changes to both directories to prevent logic drift.

Example code snippets:

# Before (deprecated)
from langchain_classic.models import AzureAIChatCompletionsModel

# After (updated)
from langchain_classic.models import AzureAIOpenAIApiChatModel

# Update initialization logic
azure_ai_provider = AzureAIOpenAIApiChatModel(...)
# Before (missing support)
# No implementation for azure_ai provider in embeddings

# After (implemented)
from langchain_classic.embeddings import AzureAIOpenAIApiEmbeddingsModel

# Map azure_ai to AzureAIOpenAIApiEmbeddingsModel
embeddings_model = AzureAIOpenAIApiEmbeddingsModel(...)

Verification

To verify the fix, test the azure_ai provider with both chat and embeddings models in langchain_classic and langchain_v1 directories. Ensure that the initialization logic works as expected and that the deprecated classes are no longer used.

Extra Tips

  • Make sure to update any documentation and examples to reflect the changes.
  • Consider adding tests to ensure the azure_ai provider works correctly with both chat and embeddings models.
  • Keep an eye on future deprecations and updates to the Azure AI API to ensure continued compatibility.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix Upgrade `azure_ai` model provider to not use deprecated classses [1 pull requests, 3 comments, 2 participants]