From 8ea1a10525aa84f36057e5fa27bb0fd5106b1607 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 15 Aug 2024 23:55:31 +0200 Subject: [PATCH] enh: `action` __event_emitter__ support --- src/lib/components/chat/Chat.svelte | 8 ++++++++ src/lib/components/chat/Messages/ResponseMessage.svelte | 1 + 2 files changed, 9 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 9d28df0c1..0a646f570 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -167,6 +167,14 @@ message.content += data.content; } else if (type === 'replace') { message.content = data.content; + } else if (type === 'action') { + if (data.action === 'continue') { + const continueButton = document.getElementById('continue-response-button'); + + if (continueButton) { + continueButton.click(); + } + } } else if (type === 'confirmation') { eventCallback = cb; diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 8e31a17c8..c95d0afc5 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -915,6 +915,7 @@