Registry /
azure / azure-ai-contentunderstanding
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ContentUnderstandingClient
✓ from azure.ai.contentunderstanding import ContentUnderstandingClient
AnalysisResult
✓ from azure.ai.contentunderstanding.models import AnalysisResult
AnalyzeOptions
✓ from azure.ai.contentunderstanding.models import AnalyzeOptions
✗ from azure.ai.contentunderstanding import AnalyzeOptions
AnalyzeOptions is in the models submodule, not top-level
Initializes client and analyzes a PDF document.
from azure.ai.contentunderstanding import ContentUnderstandingClient
from azure.ai.contentunderstanding.models import AnalyzeOptions
import os
endpoint = os.environ.get('AZURE_CONTENT_UNDERSTANDING_ENDPOINT', '')
credential = DefaultAzureCredential()
client = ContentUnderstandingClient(endpoint, credential)
# Analyze a document
with open('sample.pdf', 'rb') as f:
result = client.analyze(f, AnalyzeOptions(content_type='application/pdf'))
print(result)
Errors
Common errors & fixes
AttributeError: module 'azure.ai.contentunderstanding' has no attribute 'ContentUnderstandingClient'
Import path is wrong; ContentUnderstandingClient is in the top-level package but the module may not be installed correctly.
fixEnsure you've installed azure-ai-contentunderstanding and import with: from azure.ai.contentunderstanding import ContentUnderstandingClient
azure.core.exceptions.HttpResponseError: (InvalidRequest) 'content_type' is required for binary content
When passing binary data (e.g., BytesIO), AnalyzeOptions must specify content_type.
fixAdd content_type argument: AnalyzeOptions(content_type='application/pdf')
azure.identity._exceptions.CredentialUnavailableError: DefaultAzureCredential failed to retrieve a token
DefaultAzureCredential requires environment variables or managed identity; none are set.
fixSet AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET or use AzureCliCredential()
Upgrade
Version history
1.1.0latest on PyPI · released Apr 20, 2026
Audit
Dependencies
No dependency data recorded yet.