diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 3c4c75967..af38d1665 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -24,7 +24,8 @@ banners, user, socket, - showCallOverlay + showCallOverlay, + tools } from '$lib/stores'; import { convertMessagesToHistory, @@ -1280,6 +1281,17 @@ bind:selectedToolIds bind:webSearchEnabled bind:atSelectedModel + availableTools={$user.role === 'admin' + ? $tools.reduce((a, e, i, arr) => { + a[e.id] = { + name: e.name, + description: e.meta.description, + enabled: false + }; + + return a; + }, {}) + : {}} {selectedModels} {messages} {submitPrompt} diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index e21387607..871025e63 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -58,8 +58,9 @@ let chatInputPlaceholder = ''; export let files = []; - export let selectedToolIds = []; + export let availableTools = {}; + export let selectedToolIds = []; export let webSearchEnabled = false; export let prompt = ''; @@ -656,15 +657,7 @@ { - a[e.id] = { - name: e.name, - description: e.meta.description, - enabled: false - }; - - return a; - }, {})} + tools={availableTools} uploadFilesHandler={() => { filesInputElement.click(); }}