streamText
The most commonly used streaming text generation API in the AI SDK. Tool calls are validated and executed within its request-response lifecycle, allowing generated text and tool invocations to be handled together. It returns a streaming result that can be consumed incrementally by client applications.
Core Facts
The AI SDK uses a layered design: the core layer (the ai package) provides unified interfaces such as streamText and generateText, and each model vendor integrates through a separate provider package.
streamText is a commonly used streaming text generation API in the AI SDK, and tool calls complete validation and execution within its synchronous request-response lifecycle.
The AI SDK encapsulates API differences among various large language model providers through the Provider pattern, allowing developers to switch underlying models by learning only one set of interfaces.
Timeline (last 90 days)
AI SDK 7.1's steering feature lets generateText, streamText, and ToolLoopAgent be corrected mid-run: steer() inserts a user message at the next step boundary without interrupting a running tool, while queue() holds subsequent instructions until the current task finishes.
AI SDK splits model output into incremental chunks through interfaces such as streamText, uniformly processes SSE / ReadableStream via the underlying ai package, and then the framework adapter layer converts it into the reactive state customary in that framework.
In the AI SDK, developers can stream results by using the `streamText` function and specifying the model `stepfun/step-5`.
To use Inkling 2 Mini in the AI SDK, simply set the model name to `thinkingmachines/inkling-2-mini` to initiate a streaming call via `streamText`.
Gemini 4 Neon supports streaming calls via the AI SDK's streamText.
After the fix b3588dc, the toolApproval approval function receives only the messages actually sent to the model in this step, excluding system messages and excluding the current response, aligning with the documented conventions of generateText and streamText.
As an official provider package, @ai-sdk/zai lets developers call Z.ai directly without writing their own compatibility layer.
For generateText, the time to first byte equals the full generation time, whereas streamText spreads the wait across the entire generation process.
Developers can pass both gateway.tools.deepseekSearch() and gateway.tools.deepseekFetch() in the tools field of AI SDK's streamText to combine search and fetching.
Developers use the model name google/gemini-omni-1.2-flash to call Gemini Omni 1.2 Flash via the generateText or streamText methods in the AI SDK, and the generated video is returned as a file.
12 more timeline events
All Facts (20)
The AI SDK uses a layered design: the core layer (the ai package) provides unified interfaces such as streamText and generateText, and each model vendor integrates through a separate provider package.
80%VerifiedstreamText is a commonly used streaming text generation API in the AI SDK, and tool calls complete validation and execution within its synchronous request-response lifecycle.
75%VerifiedThe AI SDK encapsulates API differences among various large language model providers through the Provider pattern, allowing developers to switch underlying models by learning only one set of interfaces.
75%UnverifiedIn the AI SDK, developers use unified core functions such as generateText, streamText and generateObject, and which provider's model is actually called is determined by the provider instance
70%UnverifiedAI SDK 7.1's steering feature lets generateText, streamText, and ToolLoopAgent be corrected mid-run: steer() inserts a user message at the next step boundary without interrupting a running tool, while queue() holds subsequent instructions until the current task finishes.
50%UnverifiedAI SDK splits model output into incremental chunks through interfaces such as streamText, uniformly processes SSE / ReadableStream via the underlying ai package, and then the framework adapter layer converts it into the reactive state customary in that framework.
50%UnverifiedIn the AI SDK, developers can stream results by using the `streamText` function and specifying the model `stepfun/step-5`.
50%UnverifiedTo use Inkling 2 Mini in the AI SDK, simply set the model name to `thinkingmachines/inkling-2-mini` to initiate a streaming call via `streamText`.
50%UnverifiedGemini 4 Neon supports streaming calls via the AI SDK's streamText.
50%UnverifiedAfter the fix b3588dc, the toolApproval approval function receives only the messages actually sent to the model in this step, excluding system messages and excluding the current response, aligning with the documented conventions of generateText and streamText.
50%UnverifiedAs an official provider package, @ai-sdk/zai lets developers call Z.ai directly without writing their own compatibility layer.
50%UnverifiedFor generateText, the time to first byte equals the full generation time, whereas streamText spreads the wait across the entire generation process.
50%UnverifiedDevelopers can pass both gateway.tools.deepseekSearch() and gateway.tools.deepseekFetch() in the tools field of AI SDK's streamText to combine search and fetching.
50%UnverifiedDevelopers use the model name google/gemini-omni-1.2-flash to call Gemini Omni 1.2 Flash via the generateText or streamText methods in the AI SDK, and the generated video is returned as a file.
50%UnverifiedPatch versions do not ship new interfaces and have zero intrusion on application code; developers do not need to change any calling method after upgrading, and the input and output parameters of interfaces such as generateText and streamText remain stable.
50%UnverifiedThe object returned by the AI SDK's streamText contains a textStream async iterator, allowing output as it is generated.
50%UnverifiedProjects using Valibot can use @ai-sdk/valibot to perform type-safe validation of tool parameters in calls such as generateText and streamText.
50%Unverified@ai-sdk/tool-web-fetch is a standard tool that can be mounted directly into the tools parameter of streamText or generateText without additional adaptation.
50%UnverifiedIn generateText, streamText, and WorkflowAgent, the SDK rejects tool calls directly before local execution, even if the model returned a tool call intent.
50%UnverifiedThe aligned behaviors include: default values, transforms, type coercion, refinement validation, unknown key handling, custom validators, repairToolCall, and various lifecycle callbacks.
50%