* fix(server): graceful stream termination on cancellation (issue #847) * Update the code with review suggestion
This commit is contained in:
@@ -84,6 +84,7 @@ export async function* chatStream(
|
||||
});
|
||||
|
||||
for await (const event of stream) {
|
||||
if (event.data == null) continue;
|
||||
yield {
|
||||
type: event.event,
|
||||
data: JSON.parse(event.data),
|
||||
|
||||
Reference in New Issue
Block a user