simulateStream
Auto-generated API reference for simulateStream.
Function: simulateStream()
simulateStream(
doFetch,extractText,errorLabel,options?):StreamSource
Defined in: utils.ts:518
Build a StreamSource from a non-streaming fetch. The adapter is auto-completing: it fetches once, then yields the text as a sequence of chunks so UIs see the same streaming shape they'd see from a native streaming provider.
Use this when you're wiring a provider that only has a non-streaming endpoint but you want consumers (useChat, the runtime) to get identical ergonomics.
#Parameters
#doFetch
(signal) => Promise<Response>
#extractText
(response) => Promise<string>
#errorLabel
string
#options?
#chunkSize?
number
#delayMs?
number
#retry?
#Returns
StreamSource