langchain-azure-ai
This package contains the LangChain integration for Microsoft Foundry (formerly known Azure AI). To learn more about how to use this package, see the LangChain documentation in Microsoft Foundry.
Start here
| I want to... | Start with |
|---|---|
| Call Microsoft Foundry models from LangChain or LangGraph | Model quick start and development guide |
| Host an existing compiled graph on Azure | Hosting guide and configuration-driven sample |
| Find deployable examples of hosted-agent features | Hosted-agent sample chooser |
| Branch, rewind, or regenerate from a completed response | Branching sample |
| Access agents on Microsoft Foundry Agent Service | Agent Service quick start |
| Apply guardrails or use Foundry tools | Content Safety and Microsoft Foundry Tools |
| Trace graph, model, and tool calls | Application Insights tracing |
| Persist graph state | FoundryCheckpointSaver backed by Foundry State Store or Azure Cosmos DB checkpointer |
| Store long-term memory across threads | Azure Cosmos DB store |
Installation
pip install -U langchain-azure-ai
For using tools, including Azure AI Document Intelligence, Azure AI Text Analytics for Health, or Azure LogicApps, please install the extras tools:
pip install -U langchain-azure-ai[tools]
For using tracing capabilities with OpenTelemetry, you need to add the extras opentelemetry:
pip install -U langchain-azure-ai[opentelemetry]
For hosting LangGraph agents with the Responses or Invocations protocol,
install the hosting extra:
pip install -U langchain-azure-ai[hosting]
If you are transitioning from Microsoft Foundry classic and you need access to deprecated classes, use [v1] extra.
pip install -U langchain-azure-ai[v1]
Quick Start with langchain-azure-ai
The langchain-azure-ai package uses the Microsoft Foundry family of SDKs and client libraries for Azure to provide first-class support of Microsoft Foundry capabilities in LangChain and LangGraph.
This package includes:
- Calling Microsoft Foundry models: use the model integrations from LangChain and LangGraph.
- Accessing agents on Microsoft Foundry Agent Service: use managed agents as nodes in your graph.
- Applying Content Safety guardrails via middleware: check agent, model, and tool inputs and outputs with Microsoft Foundry Content Safety.
- Hosting LangGraph agents on Microsoft Foundry (server): serve your own LangGraph agents on Microsoft Foundry through Responses or Invocations HTTP endpoints.
- Using Microsoft Foundry Tools: call Azure services such as Content Understanding and Document Intelligence with Microsoft Foundry Tools.
- Searching documents (vector store): index and search documents with Azure AI Search.
For more details and tutorials, see Get started with LangChain and LangGraph with Foundry.
Calling Microsoft Foundry models
Call a Microsoft Foundry model using the Chat Completions API:
from langchain_azure_ai.chat_models import AzureAIOpenAIApiChatModel
from langchain_core.messages import HumanMessage, SystemMessage
model = AzureAIOpenAIApiChatModel(
endpoint="https://{your-resource-name}.services.ai.azure.com/openai/v1",
credential="your-api-key", #if using Entra ID you can should use DefaultAzureCredential() instead
model="gpt-5"
)
messages = [
SystemMessage(
content="Translate the following from English into Italian"
),
HumanMessage(content="hi!"),
]
model.invoke(messages).pretty_print()
================================== Ai Message ==================================
Ciao!
You can also use builtin tools with them:
from langchain_azure_ai.tools.builtin import ImageGenerationTool
model_with_image_gen = model.bind_tools([ImageGenerationTool(model="gpt-image-1.5", size="1024x1024")])
result = model_with_image_gen.invoke(
"Generate an image based on the following description: A futuristic cityscape at sunset with flying cars and neon lights."
)
Models in Microsoft Foundry Models are OpenAI-compatible and can be used with the class:
model = AzureAIOpenAIApiChatModel(
endpoint="https://{your-resource-name}.services.ai.azure.com/openai/v1",
credential="your-api-key",
model="Mistral-Large-3"
)
Generate embeddings for search and retrieval using an embedding model deployment:
from langchain_azure_ai.embeddings import AzureAIOpenAIApiEmbeddingsModel
embeddings = AzureAIOpenAIApiEmbeddingsModel(
endpoint="https://{your-resource-name}.services.ai.azure.com/openai/v1",
credential="your-api-key",
model="text-embedding-3-small", # your embedding model deployment name
)
query_vector = embeddings.embed_query("What is Microsoft Foundry?")
document_vectors = embeddings.embed_documents(
["Microsoft Foundry helps you build AI applications."]
)
Accessing agents on Microsoft Foundry Agent Service
Create a managed Foundry agent and add it as a LangGraph node.
For local development, install the package and sign in:
pip install -U langchain-azure-ai
az login
Using create_prompt_agent(..., trace=True) also requires the opentelemetry extra.
Set your project endpoint and model deployment name. This creates a version
of my-echo-agent in your project:
from azure.identity import DefaultAzureCredential
from langchain_core.messages import HumanMessage
from langgraph.graph import END, START, StateGraph
from langchain_azure_ai.agents import AgentServiceAgentState, AgentServiceFactory
from langchain_azure_ai.utils.agents import pretty_print
factory = AgentServiceFactory(
project_endpoint="https://{your-resource-name}.services.ai.azure.com/api/projects/{your-project}",
credential=DefaultAzureCredential()
)
echo_node = factory.create_prompt_agent_node(
name="my-echo-agent",
model="gpt-4.1", # your model deployment name
instructions="Always reply with the opposite of what the user says.",
)
Agent Service nodes run in Microsoft Foundry but can be added to any graph:
graph = StateGraph(AgentServiceAgentState)
graph.add_node("expert_node", echo_node)
graph.add_edge(START, "expert_node")
graph.add_edge("expert_node", END)
Use the graph as usual:
agent = graph.compile()
messages = [HumanMessage(content="I'm a genius and I love programming!")]
response = agent.invoke({"messages": messages})
pretty_print(response)
================================ Human Message =================================
I'm a genius and I love programming!
================================== Ai Message ==================================
Name: my-echo-agent
You're not a genius and you don't love programming!
Applying Content Safety guardrails via middleware
Use a Content Safety guardrail policy with any LangChain create_agent agent:
from langchain.agents import create_agent
from langchain_azure_ai.agents.middleware import AzureContentSafetyPolicyMiddleware
agent = create_agent(
model=model,
middleware=[
AzureContentSafetyPolicyMiddleware(
policy_id="your-guardrail-id",
endpoint="https://your-resource.cognitiveservices.azure.com",
)
],
)
This preview integration requires azure-ai-contentsafety>=1.1.0b1. It submits agent and model input/output and tool arguments/results to the service; the guardrail policy controls each intervention point. The same text may be checked at both agent and model boundaries. A blocked policy verdict raises ContentSafetyViolationError; allowed transformations are applied, and non-blocking findings are available via get_content_safety_annotations. Agent/model hooks screen text; tool hooks screen JSON-encoded arguments and results. See the runnable example.
Hosting LangGraph agents on Microsoft Foundry
Responses protocol
Already have a compiled LangGraph graph? Keep its implementation,
model, and tools. Point langgraph.json at its exported graph, as shown
in the Responses run-entrypoint sample,
then launch it from the directory containing that configuration:
pip install -U "langchain-azure-ai[hosting]"
python -m langchain_azure_ai.agents.hosting.run --protocol responses
For prerequisites, local requests, and Azure deployment, follow the LangGraph hosting guide or the hosted-agent samples.
For platform configuration and deployment examples, see the Foundry LangGraph samples.
You can also host the graph directly from Python, as shown below:
from langchain_azure_ai.agents.hosting import ResponsesHostServer
graph = build_my_graph() # returns a compiled LangGraph graph
if __name__ == "__main__":
ResponsesHostServer(graph).run()
ResponsesHostServer serves the OpenAI Responses-style /responses endpoint.
The graph's input state must include a messages field.
It supports JSON and streaming responses, background execution, conversation
steering, and human-in-the-loop interrupts.
Conversation steering (steerable_conversations=True) and crash recovery
(resilient_background=True) are experimental and emit feature-level
ExperimentalWarning warnings when enabled.
For current feature support and configuration combinations, see the Responses hosting overview.
The Responses host uses one conversation-state source per graph. The policy depends on whether the hosted graph has a LangGraph checkpointer:
| Graph configuration | Conversation source | Graph input on later turns |
|---|---|---|
| Graph compiled with a checkpointer | LangGraph checkpoint state keyed by the conversation/thread ID and, when available, the platform-provided user partition key | Current request input only |
| Graph without a checkpointer | Responses transcript history from the underlying response provider | Prior Responses history plus current input |
Checkpointed multi-turn conversations use an explicit conversation.id
or run with steerable_conversations=True. Both modes are linear and preserve
the latest LangGraph checkpoint for subsequent turns.
[Experimental] Response branching: Enable enable_response_branching=True
with a history-preserving checkpointer to branch from a completed response
using previous_response_id. Enabling it emits an ExperimentalWarning. See the
branching sample
for branching, rewind, regeneration, and setup requirements.
Invocations protocol
Use InvocationsHostServer to serve your graph through the /invocations endpoint:
from langchain_azure_ai.agents.hosting import InvocationsHostServer
graph = build_my_graph() # returns a compiled LangGraph graph
if __name__ == "__main__":
InvocationsHostServer(graph).run()
To launch with langgraph.json, use --protocol invocations.
InvocationsHostServer also supports background execution, conversation steering,
and human-in-the-loop interrupts. Enable resilient_background=True for durable
background turns, or steerable_conversations=True to let a new turn supersede an
active turn in the same agent_session_id. Resilient background execution requires
a LangGraph checkpointer; use a durable checkpointer for hosted production
deployments.
Steering and durable background recovery are experimental and emit feature-level
ExperimentalWarning warnings when enabled.
See the Invocations hosting overview for configuration, request formats, polling, cancellation, and interrupt handling, and the Invocations run-entrypoint sample for setup and deployment.
Persisting graph state
Use FoundryCheckpointSaver to persist LangGraph runtime state, including
checkpoints and pending writes, in Foundry State Store so a hosted graph
can resume across turns and container restarts. It is an async-only
checkpointer, separate from the Responses transcript store.
Compile the graph with the saver and keep its async context open for the
host's lifetime:
from langchain_azure_ai.agents.hosting import (
FoundryCheckpointSaver,
ResponsesHostServer,
)
async def main() -> None:
async with FoundryCheckpointSaver() as checkpointer:
graph = builder.compile(checkpointer=checkpointer)
await ResponsesHostServer(graph).run_async()
Locally, FoundryCheckpointSaver uses files under
~/.agentserver/state_stores. Set AGENTSERVER_STATE_ROOT to choose another
state root. Reuse that directory and the same conversation/thread ID across
local restarts. These files stay on the local machine.
Foundry-hosted agents use Foundry State Store with container protocol
2.0.0, which supplies the hosted request context. See
storage choices for the separate
roles of graph checkpoints, conversation references, and response storage.
For an end-to-end example that selects an in-memory saver locally and
FoundryCheckpointSaver when hosted, see the
workflow sample.
If you want database-backed checkpoints, use the async CosmosDBSaver in the
Cosmos DB hosting guidance.
Both hosts invoke graphs asynchronously, so CosmosDBSaverSync is not
compatible. Cross-thread long-term memory is a separate concern; use a
LangGraph store
rather than a checkpointer for that purpose.
Tracing with Azure Application Insights
To trace your LangChain / LangGraph applications with Azure Application Insights, first install the OpenTelemetry extras:
pip install -U langchain-azure-ai[opentelemetry]
Then enable auto tracing in your application. Every BaseCallbackManager and LangGraph callback manager created after this call will automatically include the Azure tracer:
from langchain_azure_ai.callbacks.tracers import enable_auto_tracing
enable_auto_tracing(
connection_string="<your-application-insights-connection-string>",
auto_configure_azure_monitor=True,
enable_content_recording=False, # set to True to capture message payloads
provider_name="azure.ai.openai",
trace_all_langgraph_nodes=True,
)
For a complete end-to-end example, see samples/enable_auto_tracing_appinsights.py.
Using Microsoft Foundry Tools
Use tools from Azure AI services as LangChain tools via AzureAIServicesToolkit. Available tools include Azure AI Content Understanding, Document Intelligence, Image Analysis, Text Analytics for Health, and more.
Azure AI Content Understanding is also available as a document loader via AzureAIContentUnderstandingLoader. See the Content Understanding loader notebook for a full walkthrough.
Changelog
-
1.4.0:
-
[NEW, Experimental] We added
AzureAIOpenAIApiDecisionsfor Azure OpenAI Decisions API integrations, including Foundry project endpoints and API key or Microsoft Entra ID authentication. #1343 -
We promoted
InvocationsHostServerandResponsesHostServerout of experimental status without changing their public interfaces. Conversation steering, resilient background execution, and response branching remain experimental and emitExperimentalWarningwhen enabled. #1373 -
[Breaking change]: We tightened v2 agent MCP approval validation. Use boolean decisions, objects with a boolean
approveand optional stringreason, or the strings"true"and"false". Other values, including previously accepted shortcuts such as"yes"and"deny", now raise validation errors instead of being converted to approval decisions. #1337 Thanks to @hyeonsang010716.Migration tip: Replace
Command(resume="yes")withCommand(resume=True)andCommand(resume="deny")withCommand(resume=False). To include a reason, useCommand(resume={"approve": False, "reason": "..."}). For approvalToolMessagecontent, use"true"/"false"or a JSON string such as'{"approve": false, "reason": "..."}'. -
We fixed v2 agent input and output schemas to respect LangChain middleware annotations. Compatibility note: Private fields, including
jump_to, are now ignored in input and omitted frominvoke()results, so callers relying on their previous exposure must update their code. These fields remain available to middleware and checkpointers, andstream_mode="values"still includes the full state. #1372 Thanks to @hyeonsang010716. -
We fixed v2 agents to execute every parallel function call, present every MCP approval request, and submit all corresponding outputs in order for both regular invocation and message streaming. #1345 Thanks to @hyeonsang010716.
-
We fixed
AzurePromptShieldMiddlewareto screen tool results before the agent model sees them, with the configured error, replace, or continue behavior. #1377 Thanks to @hyeonsang010716. -
We fixed
AzureAIMemoryMiddlewareto track processed messages per thread, send each new turn without a checkpointer, and recover queued or failed updates still present in checkpointed messages after recreation. Initial history sends only the latest turn, and summarization messages are excluded. #1347 Thanks to @hyeonsang010716. -
We made
ResponsesHostServerrejectresilient_background=Truewithout a LangGraph checkpointer at construction, including when an existingappis supplied. #1351 -
We deferred optional tracing imports in v1 and v2
AgentServiceFactoryuntilcreate_prompt_agent(trace=True), so disabling tracing no longer requires theopentelemetryextra. Requests with tracing enabled validate these dependencies before creating a remote agent. #1349 -
We expanded the Invocations and Responses hosting references and added a guide for deploying LangGraph as a Foundry hosted agent. #1333 #1334 #1268
-
-
1.3.1:
- We added a hosting telemetry flag that records whether response branching is enabled. #1307
- We fixed
AzureSearch.add_texts()andaadd_texts()to upload texts supplied as generators or other one-shot iterables instead of silently returning no results. #1330 Thanks to @hyeonsang010716. - We fixed
AzureSearch.from_embeddings()andafrom_embeddings()to accept constructor options without forwarding them to document uploads, while preserving supplied document keys. #1328 Thanks to @hyeonsang010716. - We fixed Azure Search authentication to use a supplied token credential or the default Azure credential when the API key is empty or omitted. Nonempty API keys retain precedence. #1327 Thanks to @hyeonsang010716.
- We fixed Azure Search custom field names to resolve when each store is constructed, so
AZURESEARCH_FIELDS_*settings work after import and remain consistent across synchronous and asynchronous operations. #918 Thanks to @cr-sbarbouche. - We fixed Azure Search retriever filtering so
search_kwargs={"filter": ...}no longer returns unfiltered results or raisesTypeError. For 1.3.0 and earlier, usesearch_kwargs={"filters": ...}as a workaround. Passing both names now raisesValueError. #1303 Thanks to @hyeonsang010716. - We fixed asynchronous Azure Search MMR searches to return an empty list when no documents match. #817 Thanks to @0xDevNinja.
- We fixed
AzureAIChatCompletionsModelto send zero-valued settings such astemperature=0andseed=0, and to let per-call options override model defaults without duplicate-keyword errors. #1269 Thanks to @pcbeingused333. - We fixed
AzureAIImageAnalysisToolconstruction and visual-feature handling, includedcaptionanddenseCaptionsin its output, and surfaced service failures instead of returning an empty result. #1302 Thanks to @hyeonsang010716. - We fixed
AzureAIOpenTelemetryTracerto use the retriever's run or class name for retriever spans when no serialized name is available. #1321 Thanks to @hyeonsang010716. - We improved documentation for SDK setup, Agent Service, durable state, and hosting. #1299 #1308 #1309 #1315 #1329
-
1.3.0:
- [NEW, Experimental] We introduced opt-in response branching through
ResponsesHostServer(graph, enable_response_branching=True). Requests withprevious_response_idstart from the completed parent's exact saved checkpoint, creating independent siblings without advancing the shared conversation head. This requires a retained parent, a history-preserving async checkpointer, steering disabled, and no externally suppliedapp; paused-parent branching is not supported. See the design document for usage scenarios and implementation gaps. #1263 #1260 #1288 - [NEW] We added
toolbox_versiontoAzureAIProjectToolboxto select a specific toolbox version. Omitting it or setting it toNonekeeps the default toolbox endpoint. #1294 - [Breaking] We made
ResponsesHostServerrejectstore=Falsewith HTTP 400 before streaming or graph execution when a LangGraph checkpointer is configured. Clients must omitstoreor setstore=True; foreground requests without a checkpointer still supportstore=False. Parent-response and branch-checkpoint validation also runs before streaming, returning HTTP 400/404 for invalid requests and a redacted HTTP 500 for unexpected backend failures. Clients must handle these HTTP errors before consuming Response or SSE events. #1290 - [Breaking] We removed
build_runnable_config_sync()from the experimentalResponsesHostServer. Callers must useawait server.build_runnable_config(request, context). #1250 - [Breaking] We removed isolation and TTL mismatch validation from
FoundryCheckpointSaverandFoundryConversationChainStore. Existing stores retain their settings without rejecting mismatches. The chain store'son_mismatchargument is now a deprecated compatibility option;"fail"no longer rejects mismatches. Applications must provision existing stores with the intended isolation and TTL. #1235 - [Breaking] We changed Responses execution errors from
internal_errorwith exception details toserver_errorwith the fixed messageAn internal error occurred.. Clients must update error-code handling and use server logs for details. #1232 - We fixed HITL resumes by requiring
langgraph>=1.2.16,<2.0, preventing completed tasks and their side effects from running again when outstanding interrupts are answered. #1258 - We fixed Azure AI Inference streaming to preserve complete tool calls whose deltas omit
index. #1221 Thanks to @pcbeingused333. - We fixed
AzureAIOpenTelemetryTracerto mark handled tool failures returned asToolMessage(status="error")as failed spans. #1160 Thanks to @Ko-Ko-Kirk. - We fixed
cosine_similarity_top_kto return empty results when no candidate qualifies, honor explicit zero limits and thresholds, and preserve eligible zero or negative similarity scores. #1238 Thanks to @cr-sbarbouche. - We fixed
AzureCosmosDBMongoVCoreSemanticCacheto use a default similarity threshold of0.5, rejecting weak matches while preserving explicitly configured thresholds, including0.0. #1241 Thanks to @cr-sbarbouche. - We reduced hosting storage overhead by reusing State Store clients within a handler and cached store bindings across requests. #1232 #1262
- We reduced repeated checkpoint and pending-write reads within Responses requests while preserving normal durability writes and latest-checkpoint checks. #1261
- We cached response-chain root IDs to avoid repeatedly traversing response history. #1251
- [NEW, Experimental] We introduced opt-in response branching through
-
1.2.12:
- We fixed
FoundryCheckpointSaverto select the latest checkpoint and order checkpoint history by LangGraph checkpoint ID rather than storage insertion order, includingbeforefiltering and namespace isolation. #1070 Thanks to @tanvir-ux. - We fixed a
TypeErrorwhen selecting similarity or hybrid search withsearch_typeinAzureSearch.asimilarity_search_with_score. #1211 Thanks to @revanth-045. - We fixed
AzureAISearchRetrieverto report search request errors instead of an unrelatedKeyErrorwhen asynchronous searches fail. #1210 Thanks to @pcbeingused333. - We fixed the File Search example in the models notebook by importing
FileSearchToolbefore binding it to the model. #1208
- We fixed
-
1.2.11:
- [NEW, Preview] We introduced
AzureContentSafetyPolicyMiddlewareto apply a Content Safety guardrail policy to agent and model messages, tool arguments, and tool results, with support for service-provided transforms and annotations. This requiresazure-ai-contentsafety>=1.1.0b1. #1141 - We mapped MCP approval responses to ordered approve/reject decisions for LangChain
HumanInTheLoopMiddleware. Invalid or conflicting decisions fail the request without resuming pending interrupts. #1058 - We preserved image and file attachments in hosted Responses requests and tool outputs. #1072 #1073
- We preserved Responses text citations and their streaming annotation events in hosted agent output. #1074
- We deferred model SDK imports during hosting startup while preserving the hosting User-Agent stamp, and added
wraptto thehostingextra so this instrumentation does not require theopentelemetryextra. #1155 - We scoped
AzureCosmosDBMongoVCoreSemanticCachelookups and clearing to the requestedllm_string, preventing cache hits and deletions across model configurations. #1030 Thanks to @cr-sbarbouche. - We fixed
AzureAIOpenTelemetryTracerto accept LangGraph interrupt and resume callbacks without callback errors. #1075 Thanks to @taekop. - We redacted agent finish output and retriever queries in
AzureAIOpenTelemetryTracerwhen content recording is disabled. #1089 Thanks to @taekop. - We fixed agent requests to honor an explicitly selected agent version while preserving dynamic version resolution for
version="latest". #1041 - We fixed project endpoint resolution to match service names exactly and honor the supplied
api_version. #1099 Thanks to @revanth-045. - We updated hosted Responses usage typing for SDK compatibility while preserving cache-write token counts. #1048 Thanks to @jkennedyvz.
- [NEW, Preview] We introduced
-
1.2.10:
- We raised the minimum supported Python version from 3.10 to 3.11 in accordance with the repository's Python support policy. Users running Python 3.10 must upgrade their runtime to install this release. #1021
-
1.2.8:
- We extended
AzureAIProjectToolboxto forward thex-agent-foundry-call-idheader on toolbox calls, ensuring per-call isolation and authorization on the toolbox side for deployed agents (hosted agent container spec 2.0.0). #785 - We fixed an issue where the LangGraph hosting wrapper for Microsoft Foundry (
langchain_azure_ai.agents.hosting) did not stream model reasoning summaries. Hosted agents configured with reasoning summaries now emit them through the streaming Responses output. #771
- We extended
-
1.2.7:
- [NEW] We extended
AzureAIProjectToolboxwith skills support: newget_skills/aget_skillsmethods load toolbox skills as DeepAgents-ready file mappings, and newget_resources/aget_resourcesmethods fetch toolbox resources (such as skills) as LangChainBlobobjects with flexible URI-scheme filtering. #700
- [NEW] We extended
-
1.2.6:
- We added a hosting User-Agent stamp on OpenAI and Anthropic SDK clients used by LangGraph agents hosted in Microsoft Foundry, so outbound model calls from hosted agents are correctly attributed to
langchain-azure-ai/hosting. #671 - We updated dependencies including
aiohttpand theuvgroup to incorporate maintenance and security updates. #654 #657 #663 #667
- We added a hosting User-Agent stamp on OpenAI and Anthropic SDK clients used by LangGraph agents hosted in Microsoft Foundry, so outbound model calls from hosted agents are correctly attributed to
-
1.2.5:
- We added
messages_keyconfigurability inAzureAIMemoryMiddlewareto support agent states that use non-default message field names. #647 - We improved Azure AI Memory and content safety middleware docstrings with clearer examples, and fixed memory retriever output context formatting for better usability. #647
- We added
-
1.2.4:
- [NEW] We introduced support for hosting LangGraph agents in Microsoft Foundry through
ResponsesHostServerandInvocationsHostServer, including checkpoint integration for conversation state. #595 - [NEW] We introduced Azure AI Memory turn-sync middleware and an on-demand memory retrieval tool to improve multi-turn memory workflows. #637
- We fixed duplicate conversation history handling and improved parallel tool call handling in hosted Responses flows. #626
- We updated Azure AI Content Understanding tooling to use the SDK
to_llm_inputhelper for improved request shaping. #554 - We introduced
AzureAIProjectToolbox.get_tools_requiring_approvalto help identify tools that require explicit user approval in agent flows. #537 - We updated key dependencies such as
urllib3,idna, andstarletteto incorporate maintenance and security updates. #592 #582 #616 #623
- [NEW] We introduced support for hosting LangGraph agents in Microsoft Foundry through
-
1.2.3:
- [NEW] We introduced
AzureAIProjectToolboxfor accessing tools managed in Azure AI Foundry projects, simplifying tool configuration and management. #525 - [NEW] We migrated speech-to-text tool for Azure AI from the community package, enabling speech integration capabilities. #499
- We updated
AzureAIOpenTelemetryTracerto emit OpenTelemetry spec-compliant spans for GenAI operations. #509 - We patched 21 security alerts across dependency packages including
langsmith,cryptography,langchain-core, and dev dependencies to improve package security posture. #496
- [NEW] We introduced
-
1.2.2:
- [NEW] We introduced
AzureAIContentUnderstandingLoaderdocument loader for extracting content from documents, images, audio, and video using Azure AI Content Understanding. #423 - [NEW] We introduced
AzureAIContentUnderstandingToolfor using Content Understanding as an agent tool, also available viaAzureAIServicesToolkit. #446 - We introduced
context_extractorsupport across content safety middleware classes, so you can control how content is extracted from agent state before safety checks run. #419 - We introduced
context_extractorsupport forAzureGroundednessMiddlewareand added a notebook example for easier adoption. #410 - We changed the default implementation of
init_chat_model("azure_ai:<your-model>")to use the OpenAI Responses API path for improved compatibility with modern LangChain chat model initialization. #409 - We fixed an
AttributeErrorinAzureAIOpenTelemetryTracer.on_chain_startwhen chain inputs were not dictionaries. #317 - We upgraded the
requestsdependency for this package to include upstream security and maintenance updates. #417 - We patched multiple high-severity dependency vulnerabilities (including
PyJWT,orjson, andtornado) to improve package security posture. #412
- [NEW] We introduced
-
1.2.1:
- You can now use
context_extractorargument in classeslangchain_azure_ai.agents.middleware.to configre how middleware instract extract content from your state. - We changed the default implementation of
init_chat_model("azure_ai:<your-model>")to use OpenAI Responses API (this is also the default if usinglangchain>=1.2.3).
- You can now use
-
1.2.0:
- We now require
langchain>=1.2so our streaming implementation matches the latest version oflangchain. - We introduced
langchain_azure_ai.agents.middleware.content_safety.*namespace which unlocks the power of Azure AI Content Safety with LangChain. - We introduced
langchain_azure_ai.tools.builtin.*namespace with server-side tools that can be used for models running in Microsoft Foundry. - We fixed an issue with duplicated spans generated in OpenTelemetry tracer. #398.
- We fixed an issue in
init_embeddings(provider="azure_ai")where an incorrect kwarg was passed.
- We now require
-
1.1.0:
- Creating agents using Foundry Agents V1 has been deprecated in favor of V2.
langchain_azure_ai.agents.AgentServiceFactorynow using V2 implementation. Namespacelangchain_azure_ai.agents.v1.AgentServiceFactoryis marked as deprecated and requires the extrav1to be used. - Chat and embedding models using Azure AI Inference SDK has been deprecated in favor of OpenAI-compatible APIs. Namespace
langchain_azure_ai.chat_models.inference.AzureAIChatCompletionsModelandlangchain_azure_ai.embeddings.inference.AzureAIEmbeddingsModelare marked as deprecated and require the extrav1to be used.
- Creating agents using Foundry Agents V1 has been deprecated in favor of V2.
-
1.0.62:
- We introduced support for asynchhronous agents operation and tracing using our OpenTelemetry tracer for context to propagate correctly. #290.
- We introduced support for Bash operations in
langchain-azure-dynamic-session. #238. - We introduced support for Agent Service V2 in Microsoft Foundry. PR #257.
- We added a new tool to generate images based on OpenAI-compatible image generation models. PR #325
- We fixed an issue when
on_tool_startignoresenable_content_recording. Now it doesn't. #261. - We fixed a problem when uploaded files were not considered by the
CodeInterpreterToolfor the Agent Service. #256. - We fixed an issue when using
AzureAIOpenTelemetryTraceron a Mac. #234.
-
1.0.61:
- This release reverts the code to the state of v1.0.5 while updating the version number to 1.0.61.
-
1.0.5:
-
1.0.4:
- We fixed an issue with dependencies resolution for
azure-ai-agentswhere the incorrect version was picked up. See #221. - We fixed an issue with
AzureAIOpenTelemetryTracerwhere spans context was not correctly propagated when called from another service. See #217. - We fixed an issue where
AzureAIOpenTelemetryTracerwhere context was deallocated incorrectly, preventing tools likelangdevto correctly emit traces. See #212. - We introduced improvements in the order in which environment variables
AZURE_AI_*are read. - Internal: We improved
AzureAIOpenTelemetryTracertest coverage. See PR #239.
- We fixed an issue with dependencies resolution for
-
1.0.2:
- We updated the
AzureAIOpenTelemetryTracerto create a parent trace for multi agent scenarios. Previously, you were required to do this manually, which was unnecesary.
- We updated the
-
1.0.0:
- We introduce support for LangChain and LangGraph 1.0.
-
0.1.8:
- We fixed some issues with
AzureAIOpenTelemetryTracer, including compliant hierarchy, tool spans under chat, finish reason normalization, conversation id. See #167 - We fixed an issue with taking image inputs for declarative agents created with Azure AI Foundry Agents service.
- We enhanced tool descriptions to improve tool call accuracy.
- We fixed some issues with
-
0.1.7:
- [NEW]: We introduce LangGraph support for declarative agents created in Azure AI Foundry. You can now compose complex graphs in LangGraph and add nodes that take advantage of Azure AI Agent Service. See
AgentServiceFactory - We fix an issue with the interface of
AzureAIEmbeddingsModel#158. - We improve the signatures of the tools
AzureAIDocumentIntelligenceTool,AzureAIImageAnalysisTool, andAzureAITextAnalyticsHealthToolPR #160.
- [NEW]: We introduce LangGraph support for declarative agents created in Azure AI Foundry. You can now compose complex graphs in LangGraph and add nodes that take advantage of Azure AI Agent Service. See
-
0.1.6:
- [Breaking change]: Using parameter
project_connection_stringto createAzureAIEmbeddingsModelandAzureAIChatCompletionsModelis not longer supported. Useproject_endpointinstead. - [Breaking change]: Class
AzureAIInferenceTracerhas been removed in favor ofAzureAIOpenTelemetryTracerwhich has a better support for OpenTelemetry and the new semantic conventions for GenAI. - Adding the following tools to the package:
AzureAIDocumentIntelligenceTool,AzureAIImageAnalysisTool, andAzureAITextAnalyticsHealthTool. You can also useAIServicesToolkitto have access to all the tools in Azure AI Services.
- [Breaking change]: Using parameter
-
0.1.4:
- Bug fix #91.
-
0.1.3:
- [Breaking change]: We renamed the parameter
model_nameinAzureAIEmbeddingsModelandAzureAIChatCompletionsModeltomodel, which is the parameter expected by the methodlangchain.chat_models.init_chat_model. - We fixed an issue with JSON mode in chat models #81.
- We fixed the dependencies for NumpPy #70.
- We fixed an issue when tracing Pyndantic objects in the inputs #65.
- We made
connection_stringparameter optional as suggested at #65.
- [Breaking change]: We renamed the parameter
-
0.1.2:
- Bug fix #35.
-
0.1.1:
- Adding
AzureCosmosDBNoSqlVectorSearchandAzureCosmosDBNoSqlSemanticCachefor vector search and full text search. - Adding
AzureCosmosDBMongoVCoreVectorSearchandAzureCosmosDBMongoVCoreSemanticCachefor vector search. - You can now create
AzureAIEmbeddingsModelandAzureAIChatCompletionsModelclients directly from your AI project's connection string using the parameterproject_connection_string. Your default Azure AI Services connection is used to find the model requested. This requires to haveazure-ai-projectspackage installed. - Support for native LLM structure outputs. Use
with_structured_output(method="json_schema")to use native structured schema support. Usewith_structured_output(method="json_mode")to use native JSON outputs capabilities. By default, LangChain usesmethod="function_calling"which uses tool calling capabilities to generate valid structure JSON payloads. This requires to haveazure-ai-inference >= 1.0.0b7. - Bug fix #18 and #31.
- Adding
-
0.1.0:
- Introduce
AzureAIEmbeddingsModelfor embedding generation andAzureAIChatCompletionsModelfor chat completions generation using the Azure AI Inference API. This client also supports GitHub Models endpoint. - Introduce
AzureAIOpenTelemetryTracerfor tracing with OpenTelemetry and Azure Application Insights.
- Introduce
Metadata
Release files for langchain-azure-ai 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_azure_ai-1.4.0.tar.gz | 313.1 kB | Without provenance | Details for langchain_azure_ai-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_azure_ai-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_azure_ai-1.4.0-py3-none-any.whl |
Total release size: 675.8 kB
Release files / langchain_azure_ai-1.4.0.tar.gz
| Download URL | langchain_azure_ai-1.4.0.tar.gz |
|---|---|
| Size | 313.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d99ff0e52eb5f249ef7fe091068cb8a18ae0d883c996fc51e80c0d73b819e19
|
|
BLAKE2b-256 checksum How to use checksums |
35c310c18fe7edf8f0749574e6c4086210223bcba6bb4d2c7aa1b46bcc81b170
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / langchain_azure_ai-1.4.0-py3-none-any.whl
| Download URL | langchain_azure_ai-1.4.0-py3-none-any.whl |
|---|---|
| Size | 362.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
caf906488a4f5653881dc8430e72a2e263eed71c7073aba2da4a0835be4b4c9b
|
|
BLAKE2b-256 checksum How to use checksums |
3802e5a08b1dfcd04e5fb1536103079fdc37a50dc56097ef0fde7b02c1f7a95d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for langchain-azure-ai 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.