# AzureAIContentUnderstandingLoader

> **Class** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/document_loaders/content_understanding/AzureAIContentUnderstandingLoader)

Load documents, images, audio, and video using Azure Content Understanding.

Produces LangChain Document objects with extracted markdown content
and rich metadata (fields, confidence scores, source info).

Exactly one of ``file_path``, ``url``, or ``bytes_source`` must be provided.

## Signature

```python
AzureAIContentUnderstandingLoader(
    self,
    endpoint: Optional[str] = None,
    credential: Optional[Union[str, AzureKeyCredential, TokenCredential]] = None,
    *,
    project_endpoint: Optional[str] = None,
    analyzer_id: Optional[str] = None,
    file_path: Optional[str] = None,
    url: Optional[str] = None,
    bytes_source: Optional[bytes] = None,
    source: Optional[str] = None,
    output_mode: OutputMode = 'markdown',
    content_range: Optional[str] = None,
    metadata_selection: Optional[List[str]] = None,
    model_deployments: Optional[Dict[str, str]] = None,
    analyze_kwargs: Optional[Dict[str, Any]] = None,
    api_version: Optional[str] = None,
)
```

## Description

**Example:**

.. code-block:: python

from azure.identity import DefaultAzureCredential
from langchain_azure_ai.document_loaders import (
    AzureAIContentUnderstandingLoader,
)

# Using a direct endpoint:
loader = AzureAIContentUnderstandingLoader(
    endpoint="https://my-resource.services.ai.azure.com",
    credential=DefaultAzureCredential(),
    file_path="report.pdf",
)

# Using an Azure AI Foundry project endpoint:
loader = AzureAIContentUnderstandingLoader(
    project_endpoint="https://my-resource.services.ai.azure.com/api/projects/my-project",
    credential=DefaultAzureCredential(),
    file_path="report.pdf",
)
docs = loader.load()

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `endpoint` | `Optional[str]` | No | CU resource endpoint URL. (default: `None`) |
| `credential` | `Optional[Union[str, AzureKeyCredential, TokenCredential]]` | No | Azure credential — API key string, ``AzureKeyCredential``, or ``TokenCredential``. (default: `None`) |
| `project_endpoint` | `Optional[str]` | No | Azure AI Foundry project endpoint URL (e.g. ``https://<resource>.services.ai.azure.com/api/projects/<project>``). Mutually exclusive with ``endpoint``. Falls back to the ``AZURE_AI_PROJECT_ENDPOINT`` environment variable. (default: `None`) |
| `analyzer_id` | `Optional[str]` | No | Analyzer to use. Defaults by input MIME type if omitted. (default: `None`) |
| `file_path` | `Optional[str]` | No | Path to a local file (mutually exclusive with ``url`` and ``bytes_source``). (default: `None`) |
| `url` | `Optional[str]` | No | Publicly accessible URL pointing to the content (mutually exclusive with ``file_path`` and ``bytes_source``). (default: `None`) |
| `bytes_source` | `Optional[bytes]` | No | Raw bytes of the content, e.g. from an in-memory download, database blob, or Azure Blob Storage response (mutually exclusive with ``file_path`` and ``url``). (default: `None`) |
| `source` | `Optional[str]` | No | Label for ``metadata["source"]``. Defaults to *file_path* or *url* when provided. (default: `None`) |
| `output_mode` | `OutputMode` | No | How to split results into Documents — ``"markdown"`` (default), ``"page"``, or ``"segment"``. Segment mode requires a custom analyzer with ``enableSegment=true`` and ``contentCategories``. Supported for document and video analyzers only — audio-based analyzers do not support segmentation. (default: `'markdown'`) |
| `content_range` | `Optional[str]` | No | Subset of input to analyze. Pages use 1-based page numbers, e.g. ``"1-3,5,9-"`` (page 1 through 3, page 5, and page 9 onward); audio/video uses milliseconds ``"0-60000"``. (default: `None`) |
| `metadata_selection` | `Optional[List[str]]` | No | What to include in metadata, e.g. ``["fields", "tables"]``. Defaults to include fields. (default: `None`) |
| `model_deployments` | `Optional[Dict[str, str]]` | No | Optional mapping of model names to deployment names. Use this to override default model deployments for custom analyzers. (default: `None`) |
| `analyze_kwargs` | `Optional[Dict[str, Any]]` | No | Extra keyword arguments forwarded to ``begin_analyze`` (e.g., ``processing_location``). (default: `None`) |
| `api_version` | `Optional[str]` | No | Content Understanding API version to use (e.g. ``"2025-11-01"``). Defaults to the latest version supported by the installed SDK. (default: `None`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    endpoint: Optional[str] = None,
    credential: Optional[Union[str, AzureKeyCredential, TokenCredential]] = None,
    *,
    project_endpoint: Optional[str] = None,
    analyzer_id: Optional[str] = None,
    file_path: Optional[str] = None,
    url: Optional[str] = None,
    bytes_source: Optional[bytes] = None,
    source: Optional[str] = None,
    output_mode: OutputMode = 'markdown',
    content_range: Optional[str] = None,
    metadata_selection: Optional[List[str]] = None,
    model_deployments: Optional[Dict[str, str]] = None,
    analyze_kwargs: Optional[Dict[str, Any]] = None,
    api_version: Optional[str] = None,
) -> None
```

| Name | Type |
|------|------|
| `endpoint` | `Optional[str]` |
| `credential` | `Optional[Union[str, AzureKeyCredential, TokenCredential]]` |
| `project_endpoint` | `Optional[str]` |
| `analyzer_id` | `Optional[str]` |
| `file_path` | `Optional[str]` |
| `url` | `Optional[str]` |
| `bytes_source` | `Optional[bytes]` |
| `source` | `Optional[str]` |
| `output_mode` | `OutputMode` |
| `content_range` | `Optional[str]` |
| `metadata_selection` | `Optional[List[str]]` |
| `model_deployments` | `Optional[Dict[str, str]]` |
| `analyze_kwargs` | `Optional[Dict[str, Any]]` |
| `api_version` | `Optional[str]` |


## Methods

- [`lazy_load()`](https://reference.langchain.com/python/langchain-azure-ai/document_loaders/content_understanding/AzureAIContentUnderstandingLoader/lazy_load)
- [`alazy_load()`](https://reference.langchain.com/python/langchain-azure-ai/document_loaders/content_understanding/AzureAIContentUnderstandingLoader/alazy_load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/document_loaders/content_understanding.py#L55)