From 37076d7920eee6f0785b0b228a33c89933093382 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sun, 2 Feb 2025 23:05:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20siliconcloud=20=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20tool=20=E7=9A=84=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/provider/sources/openai_source.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astrbot/core/provider/sources/openai_source.py b/astrbot/core/provider/sources/openai_source.py index 3ffafe2f8..78cfeb276 100644 --- a/astrbot/core/provider/sources/openai_source.py +++ b/astrbot/core/provider/sources/openai_source.py @@ -101,8 +101,10 @@ class ProviderOpenAIOfficial(Provider): stream=False ) except BaseException as e: + # 处理不支持 Function Calling 的模型 if 'does not support Function Calling' in str(e) \ - or 'does not support tools' in str(e): # ollama + or 'does not support tools' in str(e) \ + or 'Function call is not supported' in str(e): # siliconcloud del payloads['tools'] logger.debug(f"模型 {self.model_name} 不支持 tools,已自动移除") completion = await self.client.chat.completions.create(