perf: siliconcloud 不支持 tool 的模型

This commit is contained in:
Soulter
2025-02-02 23:05:36 +08:00
parent 78347ec91b
commit 37076d7920
@@ -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(