From 1588477ca3f570804a1a6be92c8104b9ea3a5f67 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 12 Nov 2024 20:33:12 -0800 Subject: [PATCH] enh: tool usage indicator --- src/lib/components/chat/MessageInput.svelte | 42 ++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 39cb88b9e..9468583b2 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -289,7 +289,7 @@
- {#if atSelectedModel !== undefined || webSearchEnabled} + {#if atSelectedModel !== undefined || selectedToolIds.length > 0 || webSearchEnabled}
@@ -323,6 +323,44 @@
{/if} + {#if selectedToolIds.length > 0} +
+
+
+ + + +
+
+ {selectedToolIds + .map((id) => { + return $tools.find((tool) => tool.id === id)?.name; + }) + .join(', ')} +
+
+
+ +
+
+ {/if} + {#if webSearchEnabled}
@@ -686,6 +724,7 @@ if (e.key === 'Escape') { console.log('Escape'); atSelectedModel = undefined; + selectedToolIds = []; webSearchEnabled = false; } }} @@ -854,6 +893,7 @@ if (e.key === 'Escape') { console.log('Escape'); atSelectedModel = undefined; + selectedToolIds = []; webSearchEnabled = false; } }}