From db58ca6c1d59dc6410c1fa55116926a6ec5fb1c6 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sat, 7 Sep 2024 21:32:18 +0800 Subject: [PATCH] fix(#5378): default plugin ids to empty array --- app/client/platforms/anthropic.ts | 2 +- app/client/platforms/moonshot.ts | 2 +- app/client/platforms/openai.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/client/platforms/anthropic.ts b/app/client/platforms/anthropic.ts index fce675a16..7dd39c9cd 100644 --- a/app/client/platforms/anthropic.ts +++ b/app/client/platforms/anthropic.ts @@ -203,7 +203,7 @@ export class ClaudeApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); return stream( path, diff --git a/app/client/platforms/moonshot.ts b/app/client/platforms/moonshot.ts index c38d3317b..cd10d2f6c 100644 --- a/app/client/platforms/moonshot.ts +++ b/app/client/platforms/moonshot.ts @@ -125,7 +125,7 @@ export class MoonshotApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); return stream( chatPath, diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index b3b306d1d..780ef0676 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -244,7 +244,7 @@ export class ChatGPTApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); // console.log("getAsTools", tools, funcs); stream(