This commit is contained in:
Timothy J. Baek 2024-06-11 00:37:31 -07:00
parent 5237439e29
commit 354683296b
2 changed files with 16 additions and 11 deletions

View File

@ -24,7 +24,8 @@
banners, banners,
user, user,
socket, socket,
showCallOverlay showCallOverlay,
tools
} from '$lib/stores'; } from '$lib/stores';
import { import {
convertMessagesToHistory, convertMessagesToHistory,
@ -1280,6 +1281,17 @@
bind:selectedToolIds bind:selectedToolIds
bind:webSearchEnabled bind:webSearchEnabled
bind:atSelectedModel 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} {selectedModels}
{messages} {messages}
{submitPrompt} {submitPrompt}

View File

@ -58,8 +58,9 @@
let chatInputPlaceholder = ''; let chatInputPlaceholder = '';
export let files = []; export let files = [];
export let selectedToolIds = [];
export let availableTools = {};
export let selectedToolIds = [];
export let webSearchEnabled = false; export let webSearchEnabled = false;
export let prompt = ''; export let prompt = '';
@ -656,15 +657,7 @@
<InputMenu <InputMenu
bind:webSearchEnabled bind:webSearchEnabled
bind:selectedToolIds bind:selectedToolIds
tools={$tools.reduce((a, e, i, arr) => { tools={availableTools}
a[e.id] = {
name: e.name,
description: e.meta.description,
enabled: false
};
return a;
}, {})}
uploadFilesHandler={() => { uploadFilesHandler={() => {
filesInputElement.click(); filesInputElement.click();
}} }}