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

Analysis Output Exporter

Utility for downloading stored document analysis outputs as searchable PDFs and figure images, with optional cleanup of the stored result.

Capabilities

Save searchable PDF

  • Given a stored analysis result ID and an output directory, writes the searchable PDF stream to <output_dir>/<result_id>.pdf, returning the saved path in the result object. @test

Save figure images

  • Given figure indexes (or all figures when none are provided), downloads each figure image and writes files named <output_dir>/<result_id>_figure_<index>.<image_format>, returning all saved paths in order. @test

Optional cleanup

  • When delete_after is true, deletes the stored analysis result after all downloads succeed and reports whether deletion occurred. @test
  • If any download fails, no deletion is attempted and the error is surfaced. @test

Implementation

@generates

API

from dataclasses import dataclass
from typing import Iterable, List, Optional

@dataclass
class ExportResult:
    pdf_path: Optional[str]
    figure_paths: List[str]
    deleted: bool

def export_analysis_assets(
    client,
    result_id: str,
    output_dir: str,
    include_pdf: bool = True,
    figure_indexes: Optional[Iterable[int]] = None,
    delete_after: bool = False,
    image_format: str = "png",
    overwrite: bool = False,
) -> ExportResult:
    """Downloads analysis outputs (searchable PDF and figure images) for a stored result ID and optionally deletes the stored result."""

Dependencies { .dependencies }

azure-ai-documentintelligence { .dependency }

Provides retrieval of stored analysis results as searchable PDFs or figure images and deletion of stored results.

Version

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