From 8565d2cbea8ff3d5bc4a17a47e95a12b7003f8ef Mon Sep 17 00:00:00 2001 From: Ben Gao Date: Mon, 20 Jan 2025 22:23:27 +0800 Subject: [PATCH] =?UTF-8?q?openai=E6=A0=BC=E5=BC=8F=E7=9A=84API=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=97=B6=EF=BC=8C=E7=94=A8=E6=88=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E9=80=9A=E8=BF=87variables=E6=8C=87=E5=AE=9Aoneapi=E7=9A=84ai?= =?UTF-8?q?=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/service/core/workflow/dispatch/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/service/core/workflow/dispatch/index.ts b/packages/service/core/workflow/dispatch/index.ts index d13ef910aeb5..c48099004497 100644 --- a/packages/service/core/workflow/dispatch/index.ts +++ b/packages/service/core/workflow/dispatch/index.ts @@ -133,6 +133,17 @@ export async function dispatchWorkFlow(data: Props): Promise { + //api调用指定了key的情况下,使用这个key + if (variables.ChatApiKey) { + externalProvider.openaiAccount = { + key: variables.ChatApiKey, + baseUrl: '' //使用系统默认的base url + }; + } + }; + handleApiKey(); + // 初始化深度和自动增加深度,避免无限嵌套 if (!props.workflowDispatchDeep) { props.workflowDispatchDeep = 1;