mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
refac
This commit is contained in:
parent
5237439e29
commit
354683296b
@ -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}
|
||||||
|
@ -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();
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user