Middleware that periodically extracts memories from turns into Azure AI Memory.
This middleware collects messages from the agent's state after each turn and sends them to Azure AI Memory in batches.
AgentMiddleware that screens text messages with Azure AI Content Safety.
Pass this class (or multiple instances) in the middleware parameter of
any LangChain create_agent call:
AgentMiddleware that screens image content with Azure AI Content Safety.
Use this middleware alongside :class:AzureContentModerationMiddleware when
your agent handles visual content. Because i
AgentMiddleware that evaluates groundedness of model outputs.
Groundedness detection analyses language model outputs to determine whether they are factually aligned with user-provided information or
AgentMiddleware that detects prompt injection using Azure AI Content Safety.
Prompt shield protects agents from adversarial inputs designed to hijack the agent's behavior. Two types of injection are
AgentMiddleware that detects protected material using Azure AI Content Safety.
Protected material detection checks whether text contains copyright-protected content such as song lyrics, news articles
Raised when content safety violations with exit_behavior='error'.
Input extracted from an agent state for text content moderation.
This is the return type for a context_extractor callable passed to
:class:`~langchain_azure_ai.agents.middleware.content_safety.Az
Input extracted from an agent state for image content moderation.
This is the return type for a context_extractor callable passed to
:class:`~langchain_azure_ai.agents.middleware.content_safety.A
Inputs extracted from an agent state for groundedness evaluation.
This is the return type for a context_extractor callable passed to
:class:`~langchain_azure_ai.agents.middleware.content_safety.A
Input extracted from an agent state for prompt shield evaluation.
This is the return type for a context_extractor callable passed to
:class:`~langchain_azure_ai.agents.middleware.content_safety.A
Extract content-safety annotation payloads from a message.
Inspects the message's content for non_standard_annotation
blocks whose value contains provider == "azure_content_safety".
Print a formatted summary of content-safety annotations on a message.
Useful for troubleshooting and inspecting middleware results in
notebooks or the console. Extracts all non_standard content