diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte index 81f7fe635..4b6350903 100644 --- a/src/lib/components/workspace/Models/ModelEditor.svelte +++ b/src/lib/components/workspace/Models/ModelEditor.svelte @@ -14,6 +14,9 @@ import ActionsSelector from '$lib/components/workspace/Models/ActionsSelector.svelte'; import Capabilities from '$lib/components/workspace/Models/Capabilities.svelte'; import Textarea from '$lib/components/common/Textarea.svelte'; + import { getTools } from '$lib/apis/tools'; + import { getFunctions } from '$lib/apis/functions'; + import { getKnowledgeItems } from '$lib/apis/knowledge'; const i18n = getContext('i18n'); @@ -30,6 +33,8 @@ let showAdvanced = false; let showPreview = false; + let loaded = false; + // /////////// // model // /////////// @@ -138,6 +143,10 @@ }; onMount(async () => { + await tools.set(await getTools(localStorage.token)); + await functions.set(await getFunctions(localStorage.token)); + await knowledgeCollections.set(await getKnowledgeItems(localStorage.token)); + // Scroll to top 'workspace-container' element const workspaceContainer = document.getElementById('workspace-container'); if (workspaceContainer) { @@ -215,292 +224,206 @@ console.log(model); } + + loaded = true; }); -