Skip to content

mistral: trace the new Responses API (client.responses) #1003

Closed as not planned

Description

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

  • mistralai 3.5 added client.responses.create / create_async (typed overloads, stream=True returns an event stream) and count_input_tokens. Nothing in integrations/mistral/patchers.py patches them, so these generation calls go completely untraced.
  • Fix: add a patcher and tracing for create / create_async, streaming and non-streaming, gated on mistralai.client.responses existing.
    • Usage carries input_tokens, output_tokens, input_tokens_details.{cached_tokens, cache_write_tokens} and output_tokens_details.reasoning_tokens. These map directly to our prompt_* / completion_* metrics.
    • The shape mirrors OpenAI Responses, so some openai Responses tracing may be reusable.
  • Tests: new cassette tests at latest. Older mistral matrix pins skip via a version gate.

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions