diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte
index f0a90c2ac..61631c333 100644
--- a/src/lib/components/chat/MessageInput.svelte
+++ b/src/lib/components/chat/MessageInput.svelte
@@ -32,6 +32,7 @@
import Commands from './MessageInput/Commands.svelte';
import XMark from '../icons/XMark.svelte';
import RichTextInput from '../common/RichTextInput.svelte';
+ import { getTools } from '$lib/apis/tools';
const i18n = getContext('i18n');
@@ -53,6 +54,7 @@
export let selectedToolIds = [];
export let webSearchEnabled = false;
+ let loaded = false;
let recording = false;
let chatInputContainerElement;
@@ -228,7 +230,11 @@
dragged = false;
};
- onMount(() => {
+ onMount(async () => {
+ await tools.set(await getTools(localStorage.token));
+
+ loaded = true;
+
window.setTimeout(() => {
const chatInput = document.getElementById('chat-input');
chatInput?.focus();
@@ -256,385 +262,537 @@