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-4/

Batch Run Control Helper

Utility to manage batch document analysis runs with continuation tokens, paginated history, and configurable result storage.

Capabilities

Start batch with storage rules

  • Starting a batch analysis using a blob container source stores results under the provided result prefix and returns identifiers for later lookup; when overwrite_existing is false and the prefix already has output, the call raises an exception instead of replacing existing files. @test

Resume from continuation token

  • Given a continuation token from a previously started batch run, resume that operation without re-submitting documents and return a summary containing the terminal status plus succeeded/failed counts. @test

Paginate run history

  • Listing historical batch runs for a model respects skip and top controls, returning only that slice along with a marker for fetching the next page. @test

Implementation

@generates

API

from typing import Any, Dict, Optional

class BatchRunManager:
    def __init__(self, client: Any):
        """Wraps the document analysis client used for batch operations."""
    
    def start_run(
        self,
        model_id: str,
        source_container_url: str,
        *,
        source_prefix: Optional[str] = None,
        result_container_url: str,
        result_prefix: Optional[str] = None,
        overwrite_existing: bool = False,
    ) -> Dict[str, str]:
        """
        Starts a batch analysis against the given source container and returns identifiers for later lookup.
        The result prefix and overwrite flag are applied to the storage location.
        Returns a mapping with at least operation_id, continuation_token, and result_location keys.
        """
    
    def resume_run(self, continuation_token: str) -> Dict[str, Any]:
        """
        Resumes a batch run from the provided continuation token and waits for completion.
        Returns a summary with terminal status and succeeded_count/failed_count keys.
        """
    
    def list_runs(self, model_id: str, *, skip: int = 0, top: int = 10) -> Dict[str, Any]:
        """
        Lists batch runs for a model honoring pagination controls.
        Returns a mapping containing the requested page of items and a next_link pointer when more data is available.
        """

Dependencies { .dependencies }

azure-ai-documentintelligence { .dependency }

Provides batch document analysis, continuation tokens, pagination over batch operations, and result storage prefix/overwrite controls.

Version

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