AgentOptions
Namespace: Vercel.AI
public sealed class AgentOptionsAgent settings.
Inheritance: object
Properties
Section titled “Properties”Instructions
Section titled “Instructions”public Instructions? Instructions { get; set; }System instructions: a string, one SystemModelMessage, or an array of them.
Value: Instructions
MaxOutputTokens
Section titled “MaxOutputTokens”public int? MaxOutputTokens { get; set; }Maximum output tokens.
Value: int?
public ILanguageModel? Model { get; set; }Explicit model.
Value: ILanguageModel
ModelId
Section titled “ModelId”public string? ModelId { get; set; }Gateway model id.
Value: string
OnAbort
Section titled “OnAbort”public Func<StreamAbortContext, CancellationToken, Task>? OnAbort { get; set; }Called after TimeoutConfiguration) is aborted. See OnAbort.
Value: Func<StreamAbortContext, CancellationToken, Task>
PrepareCall
Section titled “PrepareCall”public Func<GenerateTextOptions, GenerateTextOptions?>? PrepareCall { get; set; }Called before each TimeoutConfiguration) and TimeoutConfiguration) call with the options the agent would use,
including the default StopWhen. Return replacement options, or null to keep them.
A returned options object that sets StopWhen replaces the default limit. Maps to prepareCall.
Value: Func<GenerateTextOptions, GenerateTextOptions>
RefineToolInput
Section titled “RefineToolInput”public IReadOnlyDictionary<string, Func<JsonElement, CancellationToken, Task<JsonElement>>>? RefineToolInput { get; set; }Refines the parsed input of tool calls. See RefineToolInput. PrepareCall can replace it.
Value: IReadOnlyDictionary<string, Func<JsonElement, CancellationToken, Task<JsonElement>>>
RepairToolCall
Section titled “RepairToolCall”public ToolCallRepairFunction? RepairToolCall { get; set; }Repairs a tool call that failed to parse. See RepairToolCall. PrepareCall can replace it.
Value: ToolCallRepairFunction
StopWhen
Section titled “StopWhen”public StopCondition? StopWhen { get; set; }Stop condition. Defaults to 10 steps.
Value: StopCondition
Temperature
Section titled “Temperature”public double? Temperature { get; set; }Temperature.
Value: double?
Timeout
Section titled “Timeout”public TimeoutConfiguration? Timeout { get; set; }Timeout of each TimeoutConfiguration) and TimeoutConfiguration) call. See Timeout.
PrepareCall can replace it. Maps to timeout of ToolLoopAgentSettings.
Value: TimeoutConfiguration
ToolCallConcurrency
Section titled “ToolCallConcurrency”public int? ToolCallConcurrency { get; set; }Maximum number of tool calls that may execute concurrently within a step. See ToolCallConcurrency. PrepareCall can replace it.
Value: int?
public IReadOnlyList<Tool>? Tools { get; set; }Tools.
Value: IReadOnlyList<Tool>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product