fix: repair stream end

This commit is contained in:
KernelDeimos
2025-02-04 14:09:28 -05:00
parent e2797c38d0
commit 8f27742038
3 changed files with 6 additions and 0 deletions
@@ -189,6 +189,7 @@ class ClaudeService extends BaseService {
}
}
}
chatStream.end();
usage_promise.resolve(counts);
};
@@ -365,6 +365,7 @@ class OpenAICompletionService extends BaseService {
if ( mode === 'text' ) textblock.end();
if ( mode === 'tool' ) toolblock.end();
message.end();
chatStream.end();
};
return new TypedValue({ $: 'ai-chat-intermediate' }, {
@@ -74,6 +74,10 @@ class AIChatStream {
this.stream = stream;
}
end () {
this.stream.end();
}
message () {
return new AIChatMessageStream(this);
}