generateText
generateText<
TOOLS,OUTPUT,OUTPUT_PARTIAL>(model):Promise<GenerateTextResult<TOOLS,OUTPUT>>
Defined in: node_modules/.bun/ai@5.0.188+27912429049419a2/node_modules/ai/dist/index.d.ts:1102
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
OUTPUT
Section titled “OUTPUT”OUTPUT = never
OUTPUT_PARTIAL
Section titled “OUTPUT_PARTIAL”OUTPUT_PARTIAL = never
Parameters
Section titled “Parameters”CallSettings & Prompt & { model: LanguageModel; tools?: TOOLS | undefined; toolChoice?: ToolChoice<NoInfer<TOOLS>> | undefined; stopWhen?: StopCondition<…> | … 1 more … | undefined; … 11 more …; _internal?: { …; } | undefined; }
The language model to use.
Returns
Section titled “Returns”Promise<GenerateTextResult<TOOLS, OUTPUT>>
A result object that contains the generated text, the results of the tool calls, and additional information.