This commit is contained in:
Timothy J. Baek
2024-06-10 20:58:47 -07:00
parent e27c264081
commit 6589464ddf
5 changed files with 64 additions and 42 deletions
+12 -18
View File
@@ -8,12 +8,15 @@
import { goto } from '$app/navigation';
import { getModels as _getModels } from '$lib/apis';
import { getOllamaVersion } from '$lib/apis/ollama';
import { getPrompts } from '$lib/apis/prompts';
import { getDocs } from '$lib/apis/documents';
import { getAllChatTags } from '$lib/apis/chats';
import { getPrompts } from '$lib/apis/prompts';
import { getDocs } from '$lib/apis/documents';
import { getTools } from '$lib/apis/tools';
import { getBanners } from '$lib/apis/configs';
import { getUserSettings } from '$lib/apis/users';
import {
user,
showSettings,
@@ -25,33 +28,21 @@
banners,
showChangelog,
config,
showCallOverlay
showCallOverlay,
tools
} from '$lib/stores';
import { REQUIRED_OLLAMA_VERSION, WEBUI_API_BASE_URL } from '$lib/constants';
import { compareVersion } from '$lib/utils';
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
import Sidebar from '$lib/components/layout/Sidebar.svelte';
import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte';
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte';
import { getBanners } from '$lib/apis/configs';
import { getUserSettings } from '$lib/apis/users';
import Help from '$lib/components/layout/Help.svelte';
import AccountPending from '$lib/components/layout/Overlay/AccountPending.svelte';
import { error } from '@sveltejs/kit';
import CallOverlay from '$lib/components/chat/MessageInput/CallOverlay.svelte';
const i18n = getContext('i18n');
let ollamaVersion = '';
let loaded = false;
let showShortcutsButtonElement: HTMLButtonElement;
let DB = null;
let localDBChats = [];
let showShortcuts = false;
const getModels = async () => {
return _getModels(localStorage.token);
};
@@ -99,6 +90,9 @@
(async () => {
documents.set(await getDocs(localStorage.token));
})(),
(async () => {
tools.set(await getTools(localStorage.token));
})(),
(async () => {
banners.set(await getBanners(localStorage.token));
})(),
@@ -1,5 +1,13 @@
<script>
import ToolkitEditor from '$lib/components/workspace/Tools/ToolkitEditor.svelte';
const saveHandler = async (data) => {
console.log(data);
};
</script>
<ToolkitEditor />
<ToolkitEditor
on:save={(e) => {
saveHandler(e.detail);
}}
/>