{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/azure-ai-contentunderstanding-py",
  "version": "1.0.1",
  "name": "Azure Ai Contentunderstanding Py",
  "description": "Azure AI Content Understanding SDK for Python. Use for multimodal content extraction from documents, images, audio, and video.\nTriggers: \"azure-ai-contentunderstanding\", \"ContentUnderstandingClient\", \"multimodal analysis\", \"document extraction\", \"video analysis\", \"audio transcription\".",
  "system_prompt_fragment": "# Azure AI Content Understanding SDK for Python\n\nMultimodal AI service that extracts semantic content from documents, video, audio, and image files for RAG and automated workflows.\n\n## Installation\n\n```bash\npip install azure-ai-contentunderstanding\n```\n\n## Environment Variables\n\n```bash\nCONTENTUNDERSTANDING_ENDPOINT=https://<resource>.cognitiveservices.azure.com/\n```\n\n## Authentication\n\n```python\nimport os\nfrom azure.ai.contentunderstanding import ContentUnderstandingClient\nfrom azure.identity import DefaultAzureCredential\n\nendpoint = os.environ[\"CONTENTUNDERSTANDING_ENDPOINT\"]\ncredential = DefaultAzureCredential()\nclient = ContentUnderstandingClient(endpoint=endpoint, credential=credential)\n```\n\n## Core Workflow\n\nContent Understanding operations are asynchronous long-running operations:\n\n1. **Begin Analysis** — Start the analysis operation with `begin_analyze()` (returns a poller)\n2. **Poll for Results** — Poll until analysis completes (SDK handles this with `.result()`)\n3. **Process Results** — Extract structured results from `AnalyzeResult.contents`\n\n## Prebuilt Analyzers\n\n| Analyzer | Content Type | Purpose |\n|----------|--------------|---------|\n| `prebuilt-documentSearch` | Documents | Extract markdown for RAG applications |\n| `prebuilt-imageSearch` | Images | Extract content from images |\n| `prebuilt-audioSearch` | Audio | Transcribe audio with timing |\n| `prebuilt-videoSearch` | Video | Extract frames, transcripts, summaries |\n| `prebuilt-invoice` | Documents | Extract invoice fields |\n\n## Analyze Document\n\n```python\nimport os\nfrom azure.ai.contentunderstanding import ContentUnderstandingClient\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\nfrom azure.identity import DefaultAzureCredential\n\nendpoint = os.environ[\"CONTENTUNDERSTANDING_ENDPOINT\"]\nclient = ContentUnderstandingClient(\n    endpoint=endpoint,\n    credential=DefaultAzureCredential()\n)\n\n# Analyze document from URL\npoller = client.begin_analyze(\n    analyzer_id=\"prebuilt-documentSearch\",\n    inputs=[AnalyzeInput(url=\"https://example.com/document.pdf\")]\n)\n\nresult = poller.result()\n\n# Access markdown content (contents is a list)\ncontent = result.contents[0]\nprint(content.markdown)\n```\n\n## Access Document Content Details\n\n```python\nfrom azure.ai.contentunderstanding.models import MediaContentKind, DocumentContent\n\ncontent = result.contents[0]\nif content.kind == MediaContentKind.DOCUMENT:\n    document_content: DocumentContent = content  # type: ignore\n    print(document_content.start_page_number)\n```\n\n## Analyze Image\n\n```python\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\n\npoller = client.begin_analyze(\n    analyzer_id=\"prebuilt-imageSearch\",\n    inputs=[AnalyzeInput(url=\"https://example.com/image.jpg\")]\n)\nresult = poller.result()\ncontent = result.contents[0]\nprint(content.markdown)\n```\n\n## Analyze Video\n\n```python\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\n\npoller = client.begin_analyze(\n    analyzer_id=\"prebuilt-videoSearch\",\n    inputs=[AnalyzeInput(url=\"https://example.com/video.mp4\")]\n)\n\nresult = poller.result()\n\n# Access video content (AudioVisualContent)\ncontent = result.contents[0]\n\n# Get transcript phrases with timing\nfor phrase in content.transcript_phrases:\n    print(f\"[{phrase.start_time} - {phrase.end_time}]: {phrase.text}\")\n\n# Get key frames (for video)\nfor frame in content.key_frames:\n    print(f\"Frame at {frame.time}: {frame.description}\")\n```\n\n## Analyze Audio\n\n```python\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\n\npoller = client.begin_analyze(\n    analyzer_id=\"prebuilt-audioSearch\",\n    inputs=[AnalyzeInput(url=\"https://example.com/audio.mp3\")]\n)\n\nresult = poller.result()\n\n# Access audio transcript\ncontent = result.contents[0]\nfor phrase in content.transcript_phrases:\n    print(f\"[{phrase.start_time}] {phrase.text}\")\n```\n\n## Custom Analyzers\n\nCreate custom analyzers with field schemas for specialized extraction:\n\n```python\n# Create custom analyzer\nanalyzer = client.create_analyzer(\n    analyzer_id=\"my-invoice-analyzer\",\n    analyzer={\n        \"description\": \"Custom invoice analyzer\",\n        \"base_analyzer_id\": \"prebuilt-documentSearch\",\n        \"field_schema\": {\n            \"fields\": {\n                \"vendor_name\": {\"type\": \"string\"},\n                \"invoice_total\": {\"type\": \"number\"},\n                \"line_items\": {\n                    \"type\": \"array\",\n                    \"items\": {\n                        \"type\": \"object\",\n                        \"properties\": {\n                            \"description\": {\"type\": \"string\"},\n                            \"amount\": {\"type\": \"number\"}\n                        }\n                    }\n                }\n            }\n        }\n    }\n)\n\n# Use custom analyzer\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\n\npoller = client.begin_analyze(\n    analyzer_id=\"my-invoice-analyzer\",\n    inputs=[AnalyzeInput(url=\"https://example.com/invoice.pdf\")]\n)\n\nresult = poller.result()\n\n# Access extracted fields\nprint(result.fields[\"vendor_name\"])\nprint(result.fields[\"invoice_total\"])\n```\n\n## Analyzer Management\n\n```python\n# List all analyzers\nanalyzers = client.list_analyzers()\nfor analyzer in analyzers:\n    print(f\"{analyzer.analyzer_id}: {analyzer.description}\")\n\n# Get specific analyzer\nanalyzer = client.get_analyzer(\"prebuilt-documentSearch\")\n\n# Delete custom analyzer\nclient.delete_analyzer(\"my-custom-analyzer\")\n```\n\n## Async Client\n\n```python\nimport asyncio\nimport os\nfrom azure.ai.contentunderstanding.aio import ContentUnderstandingClient\nfrom azure.ai.contentunderstanding.models import AnalyzeInput\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def analyze_document():\n    endpoint = os.environ[\"CONTENTUNDERSTANDING_ENDPOINT\"]\n    credential = DefaultAzureCredential()\n    \n    async with ContentUnderstandingClient(\n        endpoint=endpoint,\n        credential=credential\n    ) as client:\n        poller = await client.begin_analyze(\n            analyzer_id=\"prebuilt-documentSearch\",\n            inputs=[AnalyzeInput(url=\"https://example.com/doc.pdf\")]\n        )\n        result = await poller.result()\n        content = result.contents[0]\n        return content.markdown\n\nasyncio.run(analyze_document())\n```\n\n## Content Types\n\n| Class | For | Provides |\n|-------|-----|----------|\n| `DocumentContent` | PDF, images, Office docs | Pages, tables, figures, paragraphs |\n| `AudioVisualContent` | Audio, video files | Transcript phrases, timing, key frames |\n\nBoth derive from `MediaContent` which provides basic info and markdown representation.\n\n## Model Imports\n\n```python\nfrom azure.ai.contentunderstanding.models import (\n    AnalyzeInput,\n    AnalyzeResult,\n    MediaContentKind,\n    DocumentContent,\n    AudioVisualContent,\n)\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `ContentUnderstandingClient` | Sync client for all operations |\n| `ContentUnderstandingClient` (aio) | Async client for all operations |\n\n## Best Practices\n\n1. **Use `begin_analyze` with `AnalyzeInput`** — this is the correct method signature\n2. **Access results via `result.contents[0]`** — results are returned as a list\n3. **Use prebuilt analyzers** for common scenarios (document/image/audio/video search)\n4. **Create custom analyzers** only for domain-specific field extraction\n5. **Use async client** for high-throughput scenarios with `azure.identity.aio` credentials\n6. **Handle long-running operations** — video/audio analysis can take minutes\n7. **Use URL sources** when possible to avoid upload overhead\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/azure-ai-contentunderstanding-py"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/azure-ai-contentunderstanding-py",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/azure-ai-contentunderstanding-py",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops"
  ],
  "lifecycle": "draft"
}