diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 9938d2b92..8535585fa 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -386,6 +386,15 @@ {continueGeneration} {mergeResponses} {regenerateResponse} + on:action={async (e) => { + console.log('action', e); + if (typeof e.detail === 'string') { + await chatActionHandler(chatId, e.detail, message.model, message.id); + } else { + const { id, event } = e.detail; + await chatActionHandler(chatId, id, message.model, message.id, event); + } + }} on:change={async () => { await updateChatById(localStorage.token, chatId, { messages: messages, diff --git a/src/lib/components/chat/Messages/MultiResponseMessages.svelte b/src/lib/components/chat/Messages/MultiResponseMessages.svelte index c4826d9af..212bd8866 100644 --- a/src/lib/components/chat/Messages/MultiResponseMessages.svelte +++ b/src/lib/components/chat/Messages/MultiResponseMessages.svelte @@ -186,6 +186,9 @@ await tick(); groupedMessagesIdx[modelIdx] = groupedMessages[modelIdx].messages.length - 1; }} + on:action={async (e) => { + dispatch('action', e.detail); + }} on:save={async (e) => { console.log('save', e);