CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-azure-ai-documentintelligence

tessl install tessl/pypi-azure-ai-documentintelligence@1.0.0

Azure AI Document Intelligence client library for Python - a cloud service that uses machine learning to analyze text and structured data from documents

Agent Success

Agent success rate when using this tile

76%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

64%

task.mdevals/scenario-6/

Custom Pipeline Requests for Document Intelligence

Build a small helper module that uses the document intelligence service's raw HTTP pipeline to issue authenticated requests that bypass the convenience methods. The helpers should start a markdown-focused analysis run and retrieve results (markdown or searchable PDF) directly from the operation endpoint.

Capabilities

Start markdown analysis via pipeline

  • Posts to /documentintelligence/documentModels/{modelId}:analyze?api-version=<api_version> with a JSON body containing the document URL and outputContentFormat set to markdown, using the provided client pipeline so service authentication and policies apply. Returns the absolute operation-location value. @test

Retrieve markdown result through pipeline

  • Performs an authenticated GET to the operation URL returned earlier, setting Accept: text/markdown, and returns the full markdown content as a string. @test

Download searchable PDF through pipeline

  • Issues an authenticated GET to the same operation URL with Accept: application/pdf and an optional pages query (e.g., pages=1-2) to fetch only selected pages. Returns the binary PDF bytes. @test

Implementation

@generates

API

def start_markdown_analysis(
    client,
    model_id: str,
    document_url: str,
    *,
    api_version: str = "2024-11-30"
) -> str:
    ...

def get_markdown_result(client, operation_location: str) -> str:
    ...

def download_pdf(
    client,
    operation_location: str,
    *,
    pages: str | None = None
) -> bytes:
    ...

Dependencies { .dependencies }

azure-ai-documentintelligence { .dependency }

Provides authenticated document intelligence pipeline and HTTP request/response helpers.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-ai-documentintelligence@1.0.x
tile.json