From 9f8e0a9258b61c59d380ad97bbc6e0251044d1ea Mon Sep 17 00:00:00 2001 From: Zhijie He Date: Sun, 13 Oct 2024 00:32:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20function=20calling?= =?UTF-8?q?=20issue,=20disable=20stream=20when=20using=20tools=20(#4335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/agent-runtime/siliconcloud/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libs/agent-runtime/siliconcloud/index.ts b/src/libs/agent-runtime/siliconcloud/index.ts index 05a600d3662c..edc28f455e0f 100644 --- a/src/libs/agent-runtime/siliconcloud/index.ts +++ b/src/libs/agent-runtime/siliconcloud/index.ts @@ -3,6 +3,14 @@ import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory'; export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({ baseURL: 'https://api.siliconflow.cn/v1', + chatCompletion: { + handlePayload: (payload) => { + return { + ...payload, + stream: !payload.tools, + } as any; + }, + }, debug: { chatCompletion: () => process.env.DEBUG_SILICONCLOUD_CHAT_COMPLETION === '1', },