Skip to content

Mistral: log new chat/agents request params (logprobs, top_k, min_tokens, ...) #922

Description

mistralai 3.2.0 added these request parameters to chat.complete, chat.stream and agents.complete:

logprobs, top_logprobs, prompt_logprobs, top_prompt_logprobs, min_tokens, repetition_penalty, top_k

Responses also gained logprobs and prompt_logprobs.

Span metadata is built from allowlists, so these parameters are currently dropped.

Proposed change

  • py/src/braintrust/integrations/mistral/tracing.py: add the new keys to _CHAT_METADATA_KEYS and _AGENTS_METADATA_KEYS.
  • Check that response logprobs survive in the logged output.
  • Extend an existing cassette-backed test in test_mistral.py to pass a few of these parameters at latest.

Found while reviewing the dependency bumps in #911 (mistralai 3.0.0 → 3.2.0).

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions