Repository navigation
fix: unmarshal Mistral array-typed chat completion content - #2979
Open
vshalpnjabi wants to merge 2 commits into
Open
vshalpnjabi wants to merge 2 commits into
vshalpnjabi wants to merge 2 commits into
Conversation
Mistral reasoning models return choices[].message.content as an array of typed parts instead of a string. The OpenAI-compatible response path now accepts that shape, mapping text parts to content and thinking parts to reasoning_content. Signed-off-by: Vishal Punjabi <10079537+vshalpnjabi@users.noreply.github.com>
✅ Deploy Preview for theagentrouter canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change makes OpenAI-compatible chat completion response unmarshalling accept Mistral reasoning-model payloads where choices[].message.content is an array of typed parts instead of a string. Text parts are mapped to content and thinking parts are mapped to reasoning_content, matching the existing reasoning_content field on the response message. The OpenAI-to-OpenAI translator can now record usage and spans for these responses instead of returning HTTP 500.
AI-assisted; I reviewed the full diff and ran the tests myself.
Related Issues/PRs (if applicable)
Fixes #2974
Special notes for reviewers (if applicable)
The request-side thinking parameter mentioned in the issue is unchanged. Streaming deltas that use array content are also unchanged, as are unknown part types (they are skipped).
Checks run: