From 3667487dd75940d81193ce4b4f7a4ea7ea3e5934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8A=E5=B0=94=E5=BC=A5=E4=BA=9A=20-=20Irmia?= <1269541505@qq.com> Date: Sat, 27 Jun 2026 15:46:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DeepSeek=20V4=20proxy=20model=20recognit?= =?UTF-8?q?ion=20=E2=80=94=20substring=20match=20instead=20of=20exact=20se?= =?UTF-8?q?t=20match=20for=20reasoning=5Fcontent=20injection=20(#9015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: DeepSeek V4 proxy model recognition — substring match for reasoning_content * fix: remove deepseek-chat/reasoner exclusion per review feedback --- astrbot/core/provider/sources/openai_source.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/astrbot/core/provider/sources/openai_source.py b/astrbot/core/provider/sources/openai_source.py index e1aa08542..00c1f0a15 100644 --- a/astrbot/core/provider/sources/openai_source.py +++ b/astrbot/core/provider/sources/openai_source.py @@ -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 = {