fix(ai): add qwen-chat-template compat mode closes #2020

This commit is contained in:
Mario Zechner
2026-03-14 05:20:27 +01:00
parent c961cda2cd
commit 03ad7ecee7
5 changed files with 24 additions and 8 deletions

View File

@@ -183,11 +183,13 @@ models: [{
},
maxTokensField: "max_tokens", // instead of "max_completion_tokens"
requiresToolResultName: true, // tool results need name field
thinkingFormat: "qwen" // uses enable_thinking: true
thinkingFormat: "qwen" // top-level enable_thinking: true
}
}]
```
Use `qwen-chat-template` instead for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking`.
> Migration note: Mistral moved from `openai-completions` to `mistral-conversations`.
> Use `mistral-conversations` for native Mistral models.
> If you intentionally route Mistral-compatible/custom endpoints through `openai-completions`, set `compat` flags explicitly as needed.
@@ -586,7 +588,9 @@ interface ProviderModelConfig {
requiresToolResultName?: boolean;
requiresAssistantAfterToolResult?: boolean;
requiresThinkingAsText?: boolean;
thinkingFormat?: "openai" | "zai" | "qwen";
thinkingFormat?: "openai" | "zai" | "qwen" | "qwen-chat-template";
};
}
```
`qwen` is for DashScope-style top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking`.