Docs: Updating Microsoft Provider Documentation to Include Azure AI (#31467)

This PR adds documentation to our Microsft Provider page for LangChain
Azure AI. This PR does not add any extra dependencies or require any
tests besides passing CI.
This commit is contained in:
Marlene 2025-06-04 15:23:01 +01:00 committed by GitHub
parent 993e34fafb
commit 4ec46aeb73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,10 +4,16 @@ keywords: [azure]
# Microsoft
All functionality related to `Microsoft Azure` and other `Microsoft` products.
All functionality related to [Microsoft Azure](https://portal.azure.com) and other [Microsoft](https://www.microsoft.com) products.
## Chat Models
Microsoft offers three main options for accessing chat models through Azure:
1. [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) - Provides access to OpenAI's powerful models like o3, 4.1, and other models through Microsoft Azure's secure enterprise platform.
2. [Azure AI](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/deploy-models) - Offers access to a variety of models from different providers including Anthropic, DeepSeek, Cohere, Phi and Mistral through a unified API.
3. [Azure ML](https://learn.microsoft.com/en-us/azure/machine-learning/) - Allows deployment and management of your own custom models or fine-tuned open-source models with Azure Machine Learning.
### Azure OpenAI
>[Microsoft Azure](https://en.wikipedia.org/wiki/Microsoft_Azure), often referred to as `Azure` is a cloud computing platform run by `Microsoft`, which offers access, management, and development of applications and services through global data centers. It provides a range of capabilities, including software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS). `Microsoft Azure` supports many programming languages, tools, and frameworks, including Microsoft-specific and third-party software and systems.
@ -29,11 +35,36 @@ os.environ["AZURE_OPENAI_API_KEY"] = "your AzureOpenAI key"
See a [usage example](/docs/integrations/chat/azure_chat_openai)
```python
from langchain_openai import AzureChatOpenAI
```
### Azure AI
>[Azure AI Foundry](https://learn.microsoft.com/en-us/azure/developer/python/get-started) provides access to a wide range of models from various providers including Azure OpenAI, DeepSeek R1, Cohere, Phi and Mistral through the `AzureAIChatCompletionsModel` class.
```bash
pip install -U langchain-azure-ai
```
Configure your API key and Endpoint.
```bash
export AZURE_INFERENCE_CREDENTIAL=your-api-key
export AZURE_INFERENCE_ENDPOINT=your-endpoint
```
```python
from langchain_azure_ai.chat_models import AzureAIChatCompletionsModel
llm = AzureAIChatCompletionsModel(
model_name="gpt-4o",
api_version="2024-05-01-preview",
)
```
See a [usage example](/docs/integrations/chat/azure_ai)
### Azure ML Chat Online Endpoint
See the documentation [here](/docs/integrations/chat/azureml_chat_endpoint) for accessing chat
@ -59,6 +90,9 @@ from langchain_openai import AzureOpenAI
```
## Embedding Models
Microsoft offers two main options for accessing embedding models through Azure:
### Azure OpenAI
See a [usage example](/docs/integrations/text_embedding/azureopenai)
@ -67,6 +101,27 @@ See a [usage example](/docs/integrations/text_embedding/azureopenai)
from langchain_openai import AzureOpenAIEmbeddings
```
### Azure AI
```bash
pip install -U langchain-azure-ai
```
Configure your API key and Endpoint.
```bash
export AZURE_INFERENCE_CREDENTIAL=your-api-key
export AZURE_INFERENCE_ENDPOINT=your-endpoint
```
```python
from langchain_azure_ai.embeddings import AzureAIEmbeddingsModel
embed_model = AzureAIEmbeddingsModel(
model_name="text-embedding-ada-002"
)
```
## Document loaders
### Azure AI Data