Interface StreamTextResult

The object returned immediately by streamText.

Consumers may iterate textStream for raw token deltas, fullStream for all event types, or simply await the promise properties for aggregated results once the stream has drained.

interface StreamTextResult {
    textStream: AsyncIterable<string, any, any>;
    fullStream: AsyncIterable<StreamPart, any, any>;
    text: Promise<string>;
    usage: Promise<TokenUsage>;
    toolCalls: Promise<ToolCallRecord[]>;
}

Properties

textStream: AsyncIterable<string, any, any>

Async iterable that yields only raw text-delta strings (filters out non-text parts).

fullStream: AsyncIterable<StreamPart, any, any>

Async iterable that yields all StreamPart events in order.

text: Promise<string>

Resolves to the fully assembled assistant reply when the stream completes.

usage: Promise<TokenUsage>

Resolves to aggregated TokenUsage when the stream completes.

toolCalls: Promise<ToolCallRecord[]>

Resolves to the ordered list of ToolCallRecords when the stream completes.