streamText
streamText<
TOOLS,OUTPUT,PARTIAL_OUTPUT>(model):StreamTextResult<TOOLS,PARTIAL_OUTPUT>
Defined in: node_modules/.bun/ai@5.0.188+27912429049419a2/node_modules/ai/dist/index.d.ts:1341
Generate a text and call tools for a given prompt using a language model.
This function streams the output. If you do not want to stream the output, use generateText instead.
Type Parameters
Section titled “Type Parameters”TOOLS extends ToolSet
OUTPUT
Section titled “OUTPUT”OUTPUT = never
PARTIAL_OUTPUT
Section titled “PARTIAL_OUTPUT”PARTIAL_OUTPUT = never
Parameters
Section titled “Parameters”CallSettings & Prompt & { model: LanguageModel; tools?: TOOLS | undefined; toolChoice?: ToolChoice<TOOLS> | undefined; stopWhen?: StopCondition<NoInfer<TOOLS>> | StopCondition<…>[] | undefined; … 16 more …; _internal?: { …; } | undefined; }
The language model to use.
Returns
Section titled “Returns”StreamTextResult<TOOLS, PARTIAL_OUTPUT>
A result object for accessing different stream types and additional information.