From 7dd8229df6bd2dbac93376855bc1d077750c69d5 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:07:50 +0300 Subject: [PATCH] Return GENERATION_STARTED to original location. Add GENERATION_AFTER_COMMANDS --- public/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/script.js b/public/script.js index dbda3e3e6..c8eb8ffda 100644 --- a/public/script.js +++ b/public/script.js @@ -413,7 +413,7 @@ export const event_types = { MESSAGE_FILE_EMBEDDED: 'message_file_embedded', IMPERSONATE_READY: 'impersonate_ready', CHAT_CHANGED: 'chat_id_changed', - GENERATION_ENTERED: 'generation_entered', + GENERATION_AFTER_COMMANDS: 'GENERATION_AFTER_COMMANDS', GENERATION_STARTED: 'generation_started', GENERATION_STOPPED: 'generation_stopped', GENERATION_ENDED: 'generation_ended', @@ -3346,7 +3346,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro generation_started = new Date(); // Occurs every time, even if the generation is aborted due to slash commands execution - await eventSource.emit(event_types.GENERATION_ENTERED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); + await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); // Don't recreate abort controller if signal is passed if (!(abortController && signal)) { @@ -3368,7 +3368,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro } // Occurs only if the generation is not aborted due to slash commands execution - await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); + await eventSource.emit(event_types.GENERATION_AFTER_COMMANDS, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); if (main_api == 'kobold' && kai_settings.streaming_kobold && !kai_flags.can_use_streaming) { toastr.error('Streaming is enabled, but the version of Kobold used does not support token streaming.', undefined, { timeOut: 10000, preventDuplicates: true });