This commit is contained in:
Timothy Jaeryang Baek 2024-11-16 21:00:20 -08:00
parent 19a23a5b7d
commit 79fbab7341
4 changed files with 13 additions and 5 deletions

View File

@ -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)
);
}
};

View File

@ -632,7 +632,7 @@
showAccessControlModal = true;
}}
>
<LockClosed strokeWidth="2.5" />
<LockClosed strokeWidth="2.5" className="size-3.5" />
<div class="text-sm font-medium flex-shrink-0">
{$i18n.t('Share')}

View File

@ -104,7 +104,7 @@
showAccessControlModal = true;
}}
>
<LockClosed strokeWidth="2.5" />
<LockClosed strokeWidth="2.5" className="size-3.5" />
<div class="text-sm font-medium flex-shrink-0">
{$i18n.t('Share')}

View File

@ -231,7 +231,7 @@ class Tools:
showAccessControlModal = true;
}}
>
<LockClosed strokeWidth="2.5" />
<LockClosed strokeWidth="2.5" className="size-3.5" />
<div class="text-sm font-medium flex-shrink-0">
{$i18n.t('Share')}