Patch Changes
-
bcce2dd: feat(stream-text): expose standalone stream transformation helpers and deprecate the equivalent
streamTextresult methods.The new
toUIMessageChunkandtoUIMessageStreamhelpers let you convert astreamTextstream(or any compatibleReadableStream<TextStreamPart<TOOLS>>) into UI message chunks without going through the result object — useful for custom transports, tests, and other producers ofTextStreamPart.result.toUIMessageStreamResponse(options)andresult.pipeUIMessageStreamToResponse(response, options)can migrate by passingtoUIMessageStream({ stream: result.stream, ...options })tocreateUIMessageStreamResponseorpipeUIMessageStreamToResponse.The new
toTextStreamhelper extracts text deltas from astreamTextstream, soresult.toTextStreamResponse(options)andresult.pipeTextStreamToResponse(response, options)can migrate tocreateTextStreamResponse({ stream: toTextStream({ stream: result.stream }), ...options })andpipeTextStreamToResponse({ response, stream: toTextStream({ stream: result.stream }), ...options }).result.toUIMessageStream,result.toUIMessageStreamResponse,result.pipeUIMessageStreamToResponse,result.toTextStreamResponse, andresult.pipeTextStreamToResponseare now@deprecated. They still work in v7 and will be removed in the next major release. Migration snippets are in the v6 → v7 migration guide.