Skip to content

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.

TOOLS extends ToolSet

RUNTIME_CONTEXT extends Context = Context

OUTPUT extends Output<any, any, any> = Output<string, string, never>

LanguageModelCallOptions & (RequestOptions<TOOLS> & Prompt) & object & ToolsContextSettings<TOOLS> & object

The language model to use.

StreamTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>

A result object for accessing different stream types and additional information.