Merge pull request #2817 from SillyTavern/emit-on-stream-error

Emit message events on stream abortion
This commit is contained in:
Cohee 2024-09-09 22:17:22 +03:00 committed by GitHub
commit 4464d3a47f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -3102,6 +3102,12 @@ class StreamingProcessor {
this.hideMessageButtons(this.messageId); this.hideMessageButtons(this.messageId);
generatedPromptCache = ''; generatedPromptCache = '';
unblockGeneration(); unblockGeneration();
const noEmitTypes = ['swipe', 'impersonate', 'continue'];
if (!noEmitTypes.includes(this.type)) {
eventSource.emit(event_types.MESSAGE_RECEIVED, this.messageId);
eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, this.messageId);
}
} }
setFirstSwipe(messageId) { setFirstSwipe(messageId) {