generateText
generateText<
TOOLS,RUNTIME_CONTEXT,OUTPUT>(model):Promise<GenerateTextResult<TOOLS,RUNTIME_CONTEXT,OUTPUT>>
Defined in: node_modules/.bun/ai@7.0.127+bca6845d7a0cc15a/node_modules/ai/dist/index.d.ts:5220
Generate a text and call tools for a given prompt using a language model.
This function does not stream the output. If you want to stream the output, use streamText 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, any>
Parameters
Section titled “Parameters”LanguageModelCallOptions & (RequestOptions<TOOLS> & Prompt) & object & ToolsContextSettings<TOOLS> & object
The language model to use.
Returns
Section titled “Returns”Promise<GenerateTextResult<TOOLS, RUNTIME_CONTEXT, OUTPUT>>
A result object that contains the generated text, the results of the tool calls, and additional information.