Add GENERATION_ENTERED event
This commit is contained in:
parent
e814d8c019
commit
ba52ceb979
|
@ -412,6 +412,7 @@ export const event_types = {
|
||||||
MESSAGE_FILE_EMBEDDED: 'message_file_embedded',
|
MESSAGE_FILE_EMBEDDED: 'message_file_embedded',
|
||||||
IMPERSONATE_READY: 'impersonate_ready',
|
IMPERSONATE_READY: 'impersonate_ready',
|
||||||
CHAT_CHANGED: 'chat_id_changed',
|
CHAT_CHANGED: 'chat_id_changed',
|
||||||
|
GENERATION_ENTERED: 'generation_entered',
|
||||||
GENERATION_STARTED: 'generation_started',
|
GENERATION_STARTED: 'generation_started',
|
||||||
GENERATION_STOPPED: 'generation_stopped',
|
GENERATION_STOPPED: 'generation_stopped',
|
||||||
GENERATION_ENDED: 'generation_ended',
|
GENERATION_ENDED: 'generation_ended',
|
||||||
|
@ -3339,6 +3340,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||||
setGenerationProgress(0);
|
setGenerationProgress(0);
|
||||||
generation_started = new Date();
|
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);
|
||||||
|
|
||||||
// Don't recreate abort controller if signal is passed
|
// Don't recreate abort controller if signal is passed
|
||||||
if (!(abortController && signal)) {
|
if (!(abortController && signal)) {
|
||||||
abortController = new AbortController();
|
abortController = new AbortController();
|
||||||
|
@ -3358,6 +3362,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_STARTED, 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) {
|
if (main_api == 'kobold' && kai_settings.streaming_kobold && !kai_flags.can_use_streaming) {
|
||||||
|
|
Loading…
Reference in New Issue