The language model to use.
Optional_internal?: { currentDate?: () => Date; generateId?: IDGenerator }Internal. For test use only. May change without notice.
Optionalexperimental_activeTools?: (keyof TOOLS)[]Limits the tools that are available for the model to call without changing the tool call and result types in the result.
Optionalexperimental_continueSteps?: booleanWhen enabled, the model will perform additional steps if the finish reason is "length" (experimental).
By default, it's set to false.
Optionalexperimental_generateMessageId?: IDGeneratorGenerate a unique ID for each message.
Optionalexperimental_output?: Output<OUTPUT, OUTPUT_PARTIAL>Optional specification for parsing structured outputs from the LLM response.
Optionalexperimental_prepareStep?: (Optional function that you can use to provide different settings for a step.
Optionalexperimental_providerMetadata?: ProviderMetadataOptionalexperimental_repairToolCall?: ToolCallRepairFunction<TOOLS>A function that attempts to repair a tool call that failed to parse.
Optionalexperimental_telemetry?: TelemetrySettingsOptional telemetry configuration (experimental).
OptionalmaxSteps?: numberMaximum number of sequential LLM calls (steps), e.g. when you use tool calls. Must be at least 1.
A maximum number is required to prevent infinite loops in the case of misconfigured tools.
By default, it's set to 1, which means that only a single LLM call is made.
The language model to use.
OptionalonStepFinish?: GenerateTextOnStepFinishCallback<TOOLS>Callback that is called when each step (LLM call) is finished, including intermediate steps.
OptionalproviderOptions?: ProviderOptionsAdditional provider-specific options. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.
OptionaltoolChoice?: ToolChoice<TOOLS>The tool choice strategy. Default: 'auto'.
Optionaltools?: TOOLSThe tools that the model can call. The model needs to support calling tools.
A result object that contains the generated text, the results of the tool calls, and additional information.
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
streamTextinstead.