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

Cross-Resource Copy Coordinator

Implements helper functions that move document models and classifiers between Azure Document Intelligence resources by combining target-generated copy authorizations with long-running pollers.

Capabilities

Copies a model between resources

  • Given source and target endpoints with a desired target model identifier, requests a target-side copy authorization, starts the copy from the source resource, and returns the copied model identifier after polling completes. @test

Copies a classifier between resources

  • Given source and target endpoints with a desired target classifier identifier, requests a target-side copy authorization, initiates the classifier copy from the source resource, and returns the new classifier identifier after polling completes. @test

Resumes a pending copy

  • When provided a continuation token captured from an in-flight copy poller, resumes polling until completion and returns the final asset identifier alongside the completed status. @test

Implementation

@generates

API

from dataclasses import dataclass
from typing import Optional, Tuple

@dataclass
class ResourceConfig:
    endpoint: str
    api_key: str
    target_asset_id: str

def copy_model(source: ResourceConfig, target: ResourceConfig, *, poll_interval: float = 5.0) -> str:
    """Initiates a cross-resource model copy using a target authorization and waits for completion. Returns the new model id from the target resource."""

def copy_classifier(source: ResourceConfig, target: ResourceConfig, *, poll_interval: float = 5.0) -> str:
    """Initiates a cross-resource classifier copy using a target authorization and waits for completion. Returns the new classifier id from the target resource."""

def resume_copy(continuation_token: str, *, poll_interval: float = 5.0) -> Tuple[str, str]:
    """Resumes a previously started model or classifier copy using a continuation token and returns a tuple of (asset_id, status) when done."""

Dependencies { .dependencies }

azure-ai-documentintelligence { .dependency }

Provides administration clients, copy authorization helpers, and pollers for model and classifier copy operations.

Version

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