Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel committed Nov 28, 2024
1 parent f7a3e9b commit a3e754b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ai/core/generate-text/stream-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,7 @@ However, the LLM results are expected to be small enough to not cause issues.

return this.fullStream
.pipeThrough(callbackTransformer)
.pipeThrough(streamPartsTransformer)
.pipeThrough(new TextEncoderStream());
.pipeThrough(streamPartsTransformer);
}

pipeDataStreamToResponse(
Expand Down Expand Up @@ -1215,6 +1214,7 @@ However, the LLM results are expected to be small enough to not cause issues.
});
}

// TODO breaking change 5.0: remove pipeThrough(new TextEncoderStream())
toDataStream(options?: {
data?: StreamData;
getErrorMessage?: (error: unknown) => string;
Expand All @@ -1223,7 +1223,7 @@ However, the LLM results are expected to be small enough to not cause issues.
const stream = this.toDataStreamInternal({
getErrorMessage: options?.getErrorMessage,
sendUsage: options?.sendUsage,
});
}).pipeThrough(new TextEncoderStream());

return options?.data ? mergeStreams(options?.data.stream, stream) : stream;
}
Expand Down

0 comments on commit a3e754b

Please sign in to comment.