streamText
streamText<
TOOLS,RUNTIME_CONTEXT,OUTPUT>(model):StreamTextResult<TOOLS,RUNTIME_CONTEXT,OUTPUT>
Defined in: node_modules/.bun/ai@7.0.127+bca6845d7a0cc15a/node_modules/ai/dist/index.d.ts:3690
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
RUNTIME_CONTEXT
Section titled “RUNTIME_CONTEXT”RUNTIME_CONTEXT extends Context = Context
OUTPUT
Section titled “OUTPUT”OUTPUT extends Output<any, any, any> = Output<string, string, never>
Parameters
Section titled “Parameters”LanguageModelCallOptions & (RequestOptions<TOOLS> & Prompt) & object & ToolsContextSettings<TOOLS> & object
The language model to use.
Returns
Section titled “Returns”StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>
A result object for accessing different stream types and additional information.