mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-19 14:55:40 +08:00
Fix: set enable_thinking to True for qwen3.8-2.4t-a95b (#18442)
This commit is contained in:
@@ -152,9 +152,10 @@ def _apply_model_family_policies(
|
||||
# Qwen3 keeps RAGFlow's system default of disabling thinking unless explicitly overridden.
|
||||
if "qwen3" in model_name_lower:
|
||||
_pop_thinking_controls()
|
||||
# -preview variants (e.g. qwen3.8-max-preview) only accept
|
||||
# -preview variants (e.g. qwen3.8-max-preview) and the flagship
|
||||
# reasoning model qwen3.8-2.4t-a95b only accept
|
||||
# enable_thinking=True; the API rejects any other value.
|
||||
if "-preview" in model_name_lower:
|
||||
if "-preview" in model_name_lower or "2.4t-a95b" in model_name_lower:
|
||||
enable_thinking = True
|
||||
else:
|
||||
enable_thinking = thinking_type == "enabled" if thinking_type else False
|
||||
|
||||
@@ -73,6 +73,33 @@ def test_qwen3_preview_ignores_disabled_thinking():
|
||||
assert kwargs["extra_body"]["enable_thinking"] is True
|
||||
|
||||
|
||||
def test_qwen3_24t_a95b_forces_thinking_true():
|
||||
"""qwen3.8-2.4t-a95b (flagship reasoning model) only accepts enable_thinking=True."""
|
||||
gen_conf, kwargs = _apply_model_family_policies(
|
||||
"qwen3.8-2.4t-a95b",
|
||||
backend="base",
|
||||
gen_conf={},
|
||||
request_kwargs={},
|
||||
)
|
||||
|
||||
assert gen_conf == {}
|
||||
assert kwargs["extra_body"]["enable_thinking"] is True
|
||||
|
||||
|
||||
def test_qwen3_24t_a95b_ignores_disabled_thinking():
|
||||
"""Even with thinking=disabled, qwen3.8-2.4t-a95b still forces enable_thinking=True."""
|
||||
gen_conf, kwargs = _apply_model_family_policies(
|
||||
"qwen3.8-2.4t-a95b",
|
||||
backend="base",
|
||||
gen_conf={"thinking": "disabled", "temperature": 0.2},
|
||||
request_kwargs={},
|
||||
)
|
||||
|
||||
assert "thinking" not in gen_conf
|
||||
assert gen_conf == {"temperature": 0.2}
|
||||
assert kwargs["extra_body"]["enable_thinking"] is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"provider",
|
||||
[SupportedLiteLLMProvider.Tongyi_Qianwen, SupportedLiteLLMProvider.Dashscope],
|
||||
|
||||
Reference in New Issue
Block a user