From 2a3f05e06fb0e14985d205188eb04c48788c7da9 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 3 May 2026 00:03:32 +0000 Subject: [PATCH] =?UTF-8?q?docs(ai):=20=E6=B3=A8=E9=87=8A=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E6=80=9D=E8=80=83=E6=A0=87=E8=AE=B0=E5=89=A5?= =?UTF-8?q?=E7=A6=BB=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 说明 think/thinking/reasoning 后缀的支持写法(空格、- 、_、括号),便于后续维护识别匹配范围。 --- app/Module/AI.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Module/AI.php b/app/Module/AI.php index 9bd253137..0c310c605 100644 --- a/app/Module/AI.php +++ b/app/Module/AI.php @@ -233,6 +233,10 @@ class AI $authParams['agency'] = $agency; } + // 从模型名末尾剥离思考标记,支持以下写法: + // 模型名 think / 模型名-thinking / 模型名_reasoning (空格、- 、_ 作分隔) + // 模型名(think) / 模型名 ( reasoning ) (括号包裹) + // 关键词三选一:think | thinking | reasoning $thinkPatterns = [ "/^(.+?)(\s+|\s*[_-]\s*)(think|thinking|reasoning)\s*$/", "/^(.+?)\s*\(\s*(think|thinking|reasoning)\s*\)\s*$/" @@ -243,6 +247,7 @@ class AI break; } } + // 命中后把关键词剥掉,只保留前面的真实模型名 if ($thinkMatch && !empty($thinkMatch[1])) { $authParams['model_name'] = $thinkMatch[1]; }