diff --git a/app/client/platforms/anthropic.ts b/app/client/platforms/anthropic.ts index fce675a1671..7dd39c9cddc 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 c38d3317bd0..cd10d2f6c15 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 b3b306d1d11..780ef0676dd 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( diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 4b9e608c9a9..dc11c572d7e 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -163,7 +163,7 @@ export function PreCode(props: { children: any }) { ); } -function CustomCode(props: { children: any }) { +function CustomCode(props: { children: any; className?: string }) { const ref = useRef(null); const [collapsed, setCollapsed] = useState(true); const [showToggle, setShowToggle] = useState(false); @@ -182,6 +182,7 @@ function CustomCode(props: { children: any }) { return ( <> - + diff --git a/app/store/plugin.ts b/app/store/plugin.ts index 74f0fbe17a4..2356c6db0a7 100644 --- a/app/store/plugin.ts +++ b/app/store/plugin.ts @@ -199,7 +199,7 @@ export const usePluginStore = createPersistStore( getAsTools(ids: string[]) { const plugins = get().plugins; - const selected = ids + const selected = (ids || []) .map((id) => plugins[id]) .filter((i) => i) .map((p) => FunctionToolService.add(p)); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 78807a2c5fe..78835d24da9 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "NextChat", - "version": "2.14.2" + "version": "2.15.1" }, "tauri": { "allowlist": {