Return GENERATION_STARTED to original location. Add GENERATION_AFTER_COMMANDS
| @@ -413,7 +413,7 @@ export const event_types = { | |||
| 413 | MESSAGE_FILE_EMBEDDED: 'message_file_embedded', | 413 | MESSAGE_FILE_EMBEDDED: 'message_file_embedded', |
| 414 | IMPERSONATE_READY: 'impersonate_ready', | 414 | IMPERSONATE_READY: 'impersonate_ready', |
| 415 | CHAT_CHANGED: 'chat_id_changed', | 415 | CHAT_CHANGED: 'chat_id_changed', |
| 416 | GENERATION_ENTERED: 'generation_entered', | 416 | GENERATION_AFTER_COMMANDS: 'GENERATION_AFTER_COMMANDS', |
| 417 | GENERATION_STARTED: 'generation_started', | 417 | GENERATION_STARTED: 'generation_started', |
| 418 | GENERATION_STOPPED: 'generation_stopped', | 418 | GENERATION_STOPPED: 'generation_stopped', |
| 419 | GENERATION_ENDED: 'generation_ended', | 419 | GENERATION_ENDED: 'generation_ended', |
| @@ -3346,7 +3346,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 3346 | generation_started = new Date(); | 3346 | generation_started = new Date(); |
| 3347 | 3347 | ||
| 3348 | // Occurs every time, even if the generation is aborted due to slash commands execution | 3348 | // Occurs every time, even if the generation is aborted due to slash commands execution |
| 3349 | await eventSource.emit(event_types.GENERATION_ENTERED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); | 3349 | await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); |
| 3350 | 3350 | ||
| 3351 | // Don't recreate abort controller if signal is passed | 3351 | // Don't recreate abort controller if signal is passed |
| 3352 | if (!(abortController && signal)) { | 3352 | if (!(abortController && signal)) { |
| @@ -3368,7 +3368,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | |||
| 3368 | } | 3368 | } |
| 3369 | 3369 | ||
| 3370 | // Occurs only if the generation is not aborted due to slash commands execution | 3370 | // Occurs only if the generation is not aborted due to slash commands execution |
| 3371 | await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); | 3371 | await eventSource.emit(event_types.GENERATION_AFTER_COMMANDS, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun); |
| 3372 | 3372 | ||
| 3373 | if (main_api == 'kobold' && kai_settings.streaming_kobold && !kai_flags.can_use_streaming) { | 3373 | if (main_api == 'kobold' && kai_settings.streaming_kobold && !kai_flags.can_use_streaming) { |
| 3374 | toastr.error('Streaming is enabled, but the version of Kobold used does not support token streaming.', undefined, { timeOut: 10000, preventDuplicates: true }); | 3374 | toastr.error('Streaming is enabled, but the version of Kobold used does not support token streaming.', undefined, { timeOut: 10000, preventDuplicates: true }); |