Skip to content

Python SDK (azure-ai-contentunderstanding 1.0.1) does not expose usage field returned by REST API #46249

@ElisaPiccin

Description

@ElisaPiccin
  • Package Name: azure-ai-contentunderstanding
  • Package Version: 1.0.1
  • Operating System: Windows
  • Python Version: 3.12

Bug description
With azure-ai-contentunderstanding==1.0.1, the usage block returned by the Content Understanding REST API does not appear in the Python SDK poller result (poller.result() / AnalysisResult).

To Reproduce

client = ContentUnderstandingClient(
    endpoint=AZURE_AI_ENDPOINT,
    # api_version=AZURE_AI_API_VERSION,
    credential=DefaultAzureCredential(),
    logging_enable=True
)
poller = client.begin_analyze(analyzer_id=ANALYZER_ID, inputs=[
                AnalysisInput(
                    data=file_bytes 
                )
            ])
result: AnalysisResult = poller.result() # <-- does NOT include "usage" data

result_str = json.dumps(result.as_dict(), indent=2)
print(result_str)

Expected behavior
usage should be accessible from the SDK result.

Screenshots
Image

Observed
REST response includes usage (document pages, contextualization tokens, token breakdown), while Python SDK result does not expose it.

This seems to be a REST/SDK model parity gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cognitive - Content Understandingcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions