Skip to content

Commit babbba2

Browse files
fix: Mistral Medium 3.5 reasoning – use reasoning_effort=high and parse ThinkChunk streaming format
Mistral Medium 3.5 with thinking enabled requires reasoning_effort="high" (not the legacy thinking:{type:"enabled",budget_tokens:...} block). When streaming with reasoning_effort="high", delta.content becomes a list of ThinkChunk objects (type="thinking", containing a array) followed by TextChunk objects (type="text"). Only after the thinking phase does delta.content revert to a plain string. The old code only checked delta.reasoning_content / delta.reasoning and missed all thinking tokens entirely. Changes: - _callMistral: replace thinking:{...} with reasoning_effort:"high" - _callMistral streaming loop: handle Array.isArray(d.content) ThinkChunk/TextChunk list format; fall back to plain-string path for non-reasoning models
1 parent 6ea61f8 commit babbba2

1 file changed

Lines changed: 94 additions & 34 deletions

File tree

0 commit comments

Comments
 (0)