Repository navigation
feat(mistral): capture usage service tier - #891
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a807faa98d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
|
||
| service_tier = _get_value(_get_value(response, "usage"), "service_tier") | ||
| if service_tier is not None: | ||
| metadata["service_tier"] = service_tier |
There was a problem hiding this comment.
Preserve the requested service tier separately
When a caller sends service_tier="auto", Mistral may report either standard or priority as the tier that actually served the request (Mistral Priority Tier documentation). Both completion finalizers merge response metadata after request metadata, so storing the usage value under the same service_tier key overwrites the requested auto value. Successful traces therefore cannot distinguish the request policy from the selected tier or detect fallback; preserve both values, for example by recording the response as usage_service_tier.
Useful? React with 👍 / 👎.
service_tierrequest options for chat and agents.usage.service_tierfrom Mistral responses as metadata, including streamed responses.Closes #867