From 14a902fcfae1226cf4c991cf923a90932727b6b2 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Sat, 11 May 2024 19:35:48 +0800 Subject: [PATCH] feat: add web search toggle on chat --- src/lib/components/chat/MessageInput.svelte | 49 +++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 6711ea2b5..8cc60e976 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -47,6 +47,8 @@ export let fileUploadEnabled = true; export let speechRecognitionEnabled = true; + export let webSearchAvailable = true; // TODO: Default to false + export let prompt = ''; export let messages = []; @@ -64,6 +66,8 @@ let isRecording = false; const MIN_DECIBELS = -45; + let useWebSearch = false; + const scrollToBottom = () => { const element = document.getElementById('messages-container'); element.scrollTop = element.scrollHeight; @@ -921,6 +925,51 @@
{#if messages.length == 0 || messages.at(-1).done == true} + {#if webSearchAvailable} + + + + {/if} + {#if speechRecognitionEnabled}