fix: DeepSeek V4 proxy model recognition — substring match instead of exact set match for reasoning_content injection (#9015)

* fix: DeepSeek V4 proxy model recognition — substring match for reasoning_content

* fix: remove deepseek-chat/reasoner exclusion per review feedback
This commit is contained in:
伊尔弥亚 - Irmia
2026-06-27 15:46:11 +08:00
committed by GitHub
parent 3db778ff09
commit 3667487dd7

View File

@@ -944,11 +944,13 @@ class ProviderOpenAIOfficial(Provider):
"""Finally convert the payload. Such as think part conversion, tool inject."""
model = payloads.get("model", "").lower()
is_gemini = "gemini" in model
deepseek_reasoning_models = {"deepseek-v4-pro", "deepseek-v4-flash"}
_deepseek_v4_markers = ("deepseek-v4-pro", "deepseek-v4-flash", "deepseek-v4")
is_deepseek_v4_reasoning = (
model in deepseek_reasoning_models
any(marker in model for marker in _deepseek_v4_markers)
or "api.deepseek.com" in self.client.base_url.host
)
# deepseek-chat and deepseek-reasoner now point to V4 models (per official website)
# MiMo 推理模型MiMo-V2.5-Pro / MiMo-V2.5 / MiMo-V2-Pro / MiMo-V2-Omni / MiMo-V2-Flash
# 要求 assistant 历史消息必须回传 reasoning_content否则返回 400
mimo_reasoning_models = {