Browse Source

enh: `action` __event_emitter__ support

Timothy J. Baek 8 months ago
parent
commit
8ea1a10525

+ 8 - 0
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;
 

+ 1 - 0
src/lib/components/chat/Messages/ResponseMessage.svelte

@@ -915,6 +915,7 @@
 										<Tooltip content={$i18n.t('Continue Response')} placement="bottom">
 											<button
 												type="button"
+												id="continue-response-button"
 												class="{isLastMessage
 													? 'visible'
 													: 'invisible group-hover:visible'} p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg dark:hover:text-white hover:text-black transition regenerate-response-button"