fix: #1097 streaming response is replaced by error message (#1099)

This commit is contained in:
Louis 2023-12-19 16:42:13 +07:00 committed by GitHub
parent 96b00bd284
commit 4653030bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
0.1.30
0.1.32

View File

@ -227,7 +227,7 @@ export default class JanInferenceNitroExtension implements InferenceExtension {
events.emit(EventName.OnMessageUpdate, message);
},
error: async (err) => {
if (instance.isCancelled) {
if (instance.isCancelled || message.content.length > 0) {
message.status = MessageStatus.Ready;
events.emit(EventName.OnMessageUpdate, message);
return;

View File

@ -217,7 +217,7 @@ export default class JanInferenceOpenAIExtension implements InferenceExtension {
events.emit(EventName.OnMessageUpdate, message);
},
error: async (err) => {
if (instance.isCancelled) {
if (instance.isCancelled || message.content.length > 0) {
message.status = MessageStatus.Ready;
events.emit(EventName.OnMessageUpdate, message);
return;