Add events for completed prompts

This commit is contained in:
Cohee
2024-06-06 00:23:12 +03:00
parent 179a099954
commit ff241dd0a9
2 changed files with 9 additions and 0 deletions

View File

@ -1286,6 +1286,9 @@ export async function prepareOpenAIMessages({
const chat = chatCompletion.getChat();
openai_messages_count = chat.filter(x => x?.role === 'user' || x?.role === 'assistant')?.length || 0;
const eventData = { chat, dryRun };
await eventSource.emit(event_types.CHAT_COMPLETION_PROMPT_READY, eventData);
return [chat, promptManager.tokenHandler.counts];
}