Add event type for text completion generation request settings ready

This commit is contained in:
Cohee 2024-02-24 21:45:33 +02:00
parent d5bf9fc28c
commit fc289126fa
2 changed files with 5 additions and 0 deletions

View File

@ -397,6 +397,7 @@ export const event_types = {
GENERATE_BEFORE_COMBINE_PROMPTS: 'generate_before_combine_prompts',
GROUP_MEMBER_DRAFTED: 'group_member_drafted',
WORLD_INFO_ACTIVATED: 'world_info_activated',
TEXT_COMPLETION_SETTINGS_READY: 'text_completion_settings_ready',
};
export const eventSource = new EventEmitter();

View File

@ -1,4 +1,6 @@
import {
eventSource,
event_types,
getRequestHeaders,
getStoppingStrings,
max_context,
@ -1048,6 +1050,8 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
params = Object.assign(params, llamaCppParams);
}
eventSource.emitAndWait(event_types.TEXT_COMPLETION_SETTINGS_READY, params);
return params;
}