feat(providers): first-class Mistral support

Mistral's API constrains reasoning_effort to "high"/"none", rejects the
kwarg entirely for Magistral (reasoning is implicit), returns assistant
content as a mixed array of {type:"thinking",...}/{type:"text",...}
blocks, and 400s on the reasoning_content key in history.

- Remap user-supplied reasoning_effort (low/medium/minimal) onto Mistral's
  two-tier vocabulary; strip the kwarg for Magistral models
- Lift thinking blocks into reasoning_content for both batch and streaming
  responses; pass only text through on_content_delta callbacks
- Drop reasoning_content from outbound history when the spec asks for it
- Expose per-preset reasoning_effort_values so the UI can render the
  provider-specific option set

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Javad Arjmandi
2026-06-18 00:08:47 +08:00
committed by Xubin Ren
co-authored by Claude Sonnet 4.6
parent 51bd3337ef
commit d5f5eb43e5
5 changed files with 516 additions and 11 deletions
+1
View File
@@ -372,6 +372,7 @@ export interface SettingsPayload {
context_window_tokens: number;
temperature: number;
reasoning_effort: string | null;
reasoning_effort_values?: string[];
}>;
providers: Array<{
name: string;