{"id":27606,"library":"azure-ai-contentunderstanding","title":"Azure AI Content Understanding","description":"Azure AI Content Understanding Python SDK (v1.1.0) from Microsoft. Provides client for analyzing and understanding content using Azure AI services. Supports synchronous and asynchronous analysis of documents, images, and text. Released on a monthly cadence.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/contentunderstanding/azure-ai-contentunderstanding","tags":["azure","content-understanding","ai","sdk","microsoft"],"install":[{"cmd":"pip install azure-ai-contentunderstanding","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"ContentUnderstandingClient","correct":"from azure.ai.contentunderstanding import ContentUnderstandingClient"},{"note":"","wrong":"","symbol":"AnalysisResult","correct":"from azure.ai.contentunderstanding.models import AnalysisResult"},{"note":"AnalyzeOptions is in the models submodule, not top-level","wrong":"from azure.ai.contentunderstanding import AnalyzeOptions","symbol":"AnalyzeOptions","correct":"from azure.ai.contentunderstanding.models import AnalyzeOptions"}],"quickstart":{"code":"from azure.ai.contentunderstanding import ContentUnderstandingClient\nfrom azure.ai.contentunderstanding.models import AnalyzeOptions\nimport os\n\nendpoint = os.environ.get('AZURE_CONTENT_UNDERSTANDING_ENDPOINT', '')\ncredential = DefaultAzureCredential()\n\nclient = ContentUnderstandingClient(endpoint, credential)\n\n# Analyze a document\nwith open('sample.pdf', 'rb') as f:\n    result = client.analyze(f, AnalyzeOptions(content_type='application/pdf'))\nprint(result)\n","lang":"python","description":"Initializes client and analyzes a PDF document."},"warnings":[{"fix":"Always pass content_type='application/pdf' (or appropriate MIME) when providing binary data.","message":"In v1.1.0, the parameter 'content_type' in AnalyzeOptions is required for binary input; omitting it causes a 400 error.","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"Use client.analyze() instead of client.begin_analyze().","message":"The method 'begin_analyze' was replaced by 'analyze' in v1.0.0; 'begin_analyze' no longer exists.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Set the required environment variables or use a different credential class like AzureCliCredential.","message":"DefaultAzureCredential requires environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET to be set. If not, it raises CredentialUnavailableError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Ensure you've installed azure-ai-contentunderstanding and import with: from azure.ai.contentunderstanding import ContentUnderstandingClient","cause":"Import path is wrong; ContentUnderstandingClient is in the top-level package but the module may not be installed correctly.","error":"AttributeError: module 'azure.ai.contentunderstanding' has no attribute 'ContentUnderstandingClient'"},{"fix":"Add content_type argument: AnalyzeOptions(content_type='application/pdf')","cause":"When passing binary data (e.g., BytesIO), AnalyzeOptions must specify content_type.","error":"azure.core.exceptions.HttpResponseError: (InvalidRequest) 'content_type' is required for binary content"},{"fix":"Set AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET or use AzureCliCredential()","cause":"DefaultAzureCredential requires environment variables or managed identity; none are set.","error":"azure.identity._exceptions.CredentialUnavailableError: DefaultAzureCredential failed to retrieve a token"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}