diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index e98ae5ca0..081d99b28 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -34,7 +34,8 @@ mobile, showOverview, chatTitle, - showArtifacts + showArtifacts, + tools } from '$lib/stores'; import { convertMessagesToHistory, @@ -78,6 +79,7 @@ import ChatControls from './ChatControls.svelte'; import EventConfirmDialog from '../common/ConfirmDialog.svelte'; import Placeholder from './Placeholder.svelte'; + import { getTools } from '$lib/apis/tools'; export let chatIdProp = ''; @@ -158,12 +160,18 @@ } const setToolIds = async () => { + if (!$tools) { + tools.set(await getTools(localStorage.token)); + } + if (selectedModels.length !== 1) { return; } const model = $models.find((m) => m.id === selectedModels[0]); if (model) { - selectedToolIds = model?.info?.meta?.toolIds ?? []; + selectedToolIds = (model?.info?.meta?.toolIds ?? []).filter((id) => + $tools.find((t) => t.id === id) + ); } }; diff --git a/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte b/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte index cd3bd55ca..f7b3ddff1 100644 --- a/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte +++ b/src/lib/components/workspace/Knowledge/KnowledgeBase.svelte @@ -632,7 +632,7 @@ showAccessControlModal = true; }} > - +
{$i18n.t('Share')} diff --git a/src/lib/components/workspace/Prompts/PromptEditor.svelte b/src/lib/components/workspace/Prompts/PromptEditor.svelte index 61ec69e4e..672279dd2 100644 --- a/src/lib/components/workspace/Prompts/PromptEditor.svelte +++ b/src/lib/components/workspace/Prompts/PromptEditor.svelte @@ -104,7 +104,7 @@ showAccessControlModal = true; }} > - +
{$i18n.t('Share')} diff --git a/src/lib/components/workspace/Tools/ToolkitEditor.svelte b/src/lib/components/workspace/Tools/ToolkitEditor.svelte index b435653f1..51004302d 100644 --- a/src/lib/components/workspace/Tools/ToolkitEditor.svelte +++ b/src/lib/components/workspace/Tools/ToolkitEditor.svelte @@ -231,7 +231,7 @@ class Tools: showAccessControlModal = true; }} > - +
{$i18n.t('Share')}