fix(providers): add Qwen model-level thinking style mapping (#5023)

Add _QWEN_THINKING_MODELS to _MODEL_THINKING_STYLES with enable_thinking style. Prevents Qwen 3.5/3.6/3.7 models from exposing raw reasoning content in chat responses. Closes #4934
This commit is contained in:
seteiro
2026-07-22 10:46:22 +08:00
committed by GitHub
parent a9867a5a4e
commit 79d9455313
2 changed files with 33 additions and 0 deletions
@@ -99,9 +99,20 @@ _THINKING_STYLE_MAP: dict[str, Any] = {
_GATEWAY_REASONING_STYLE_MAP: dict[str, Any] = {
"reasoning_effort": lambda effort: {"reasoning": {"effort": effort}},
}
_QWEN_THINKING_MODELS: frozenset[str] = frozenset({
"qwen3.7-max",
"qwen3.7-plus",
"qwen3.6-max-preview",
"qwen3.6-plus",
"qwen3.6-flash",
"qwen3.5-plus",
"qwen3.5-flash",
})
_MODEL_THINKING_STYLES: dict[str, str] = {
**dict.fromkeys(_KIMI_THINKING_MODELS, "thinking_type"),
**dict.fromkeys(_MIMO_THINKING_MODELS, "thinking_type"),
**dict.fromkeys(_QWEN_THINKING_MODELS, "enable_thinking"),
}