Generation options (same shape as generateText).
A StreamTextResult with async iterables and awaitable promises.
const { textStream } = streamText({ model: 'openai:gpt-4o', prompt: 'Tell me a joke.' });
for await (const chunk of textStream) {
process.stdout.write(chunk);
}
Stateless streaming text generation with optional multi-step tool calling.
Returns a StreamTextResult immediately; the underlying provider call begins lazily when a consumer starts iterating
textStreamorfullStream. Awaitingtext,usage, ortoolCallswill also drain the stream.