Skip to content

pydantic-ai: read RequestUsage.output_reasoning_tokens for reasoning metrics #1005

Closed

Description

Sub-issue of #1001 (follow-ups from the 2026-10-26 dependency update, #998).

  • We get reasoning tokens by checking provider-specific keys in usage.details (integrations/pydantic_ai/tracing.py:1424-1440). That still works because pydantic-ai keeps filling those keys.
  • The new field is provider-agnostic. Reading it first, with the keys as fallback, guards against the keys going away or providers we don't map. Covered by existing cassettes.

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions