refac
This commit is contained in:
1 parent
53cd660de7
commit
b1006a2b57
1 file changed
+14
@@ -5,6 +5,8 @@
|
|||||||
import { flyAndScale } from '$lib/utils/transitions';
|
import { flyAndScale } from '$lib/utils/transitions';
|
||||||
|
|
||||||
import { config, user, tools as _tools, mobile, knowledge, chats } from '$lib/stores';
|
import { config, user, tools as _tools, mobile, knowledge, chats } from '$lib/stores';
|
||||||
|
import { getKnowledgeBases } from '$lib/apis/knowledge';
|
||||||
|
|
||||||
import { createPicker } from '$lib/utils/google-drive-picker';
|
import { createPicker } from '$lib/utils/google-drive-picker';
|
||||||
|
|
||||||
import Dropdown from '$lib/components/common/Dropdown.svelte';
|
import Dropdown from '$lib/components/common/Dropdown.svelte';
|
||||||
@@ -67,6 +69,16 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const init = async () => {
|
||||||
|
if ($knowledge === null) {
|
||||||
|
await knowledge.set(await getKnowledgeBases(localStorage.token));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$: if (show) {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
const onSelect = (item) => {
|
const onSelect = (item) => {
|
||||||
if (files.find((f) => f.id === item.id)) {
|
if (files.find((f) => f.id === item.id)) {
|
||||||
return;
|
return;
|
||||||
@@ -220,6 +232,7 @@
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if ($knowledge ?? []).length > 0}
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={fileUploadCapableModels.length !== selectedModels.length
|
content={fileUploadCapableModels.length !== selectedModels.length
|
||||||
? $i18n.t('Model(s) do not support file upload')
|
? $i18n.t('Model(s) do not support file upload')
|
||||||
@@ -249,6 +262,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if ($chats ?? []).length > 0}
|
{#if ($chats ?? []).length > 0}
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
Reference in new issue
Block a user