From 7bcb43000823298711db8769831f4fd38ba7af64 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 10 Nov 2024 19:11:06 -0800 Subject: [PATCH] enh: web search indicator --- .../components/admin/UserChatsModal.svelte | 2 +- src/lib/components/chat/MessageInput.svelte | 90 +++++++++++++------ 2 files changed, 65 insertions(+), 27 deletions(-) diff --git a/src/lib/components/admin/UserChatsModal.svelte b/src/lib/components/admin/UserChatsModal.svelte index 535dee074..9f39af0ff 100644 --- a/src/lib/components/admin/UserChatsModal.svelte +++ b/src/lib/components/admin/UserChatsModal.svelte @@ -75,7 +75,7 @@ {#if chats.length > 0}
- +
diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 6dd6ff258..2767b296e 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -289,35 +289,71 @@
- {#if atSelectedModel !== undefined} + {#if atSelectedModel !== undefined || webSearchEnabled}
-
- model profile model.id === atSelectedModel.id)?.info?.meta - ?.profile_image_url ?? - ($i18n.language === 'dg-DG' - ? `/doge.png` - : `${WEBUI_BASE_URL}/static/favicon.png`)} - /> -
- Talking to {atSelectedModel.name} + {#if atSelectedModel !== undefined} +
+
+ model profile model.id === atSelectedModel.id)?.info?.meta + ?.profile_image_url ?? + ($i18n.language === 'dg-DG' + ? `/doge.png` + : `${WEBUI_BASE_URL}/static/favicon.png`)} + /> +
+ Talking to {atSelectedModel.name} +
+
+
+ +
-
-
- -
+ {/if} + + {#if webSearchEnabled} +
+
+
+ + + +
+
{$i18n.t('Search the web')}
+
+
+ +
+
+ {/if}
{/if} @@ -659,6 +695,7 @@ if (e.key === 'Escape') { console.log('Escape'); atSelectedModel = undefined; + webSearchEnabled = false; } }} on:paste={async (e) => { @@ -826,6 +863,7 @@ if (e.key === 'Escape') { console.log('Escape'); atSelectedModel = undefined; + webSearchEnabled = false; } }} rows="1"