Skip to content

ParseToolCallOptions

Namespace: Vercel.AI.GenerateText

public sealed class ParseToolCallOptions

Options of CancellationToken). Maps to the options of parseToolCall.

Inheritance: object

View source

public ParseToolCallOptions(GeneratedToolCall toolCall)

Creates options for <code class=“paramref”>toolCall</code>.

Parameters

Name Type Description
toolCall GeneratedToolCall

View source

public Instructions? Instructions { get; init; }

The instructions given to the model. They are passed to RepairToolCall.

Value: Instructions

View source

public IReadOnlyList<ModelMessage>? Messages { get; init; }

The messages of the current step. They are passed to RepairToolCall.

Value: IReadOnlyList<ModelMessage>

View source

public IReadOnlyDictionary<string, Func<JsonElement, CancellationToken, Task<JsonElement>>>? RefineToolInput { get; init; }

Refines the input of a valid call, keyed by tool name. A tool without an entry keeps its parsed input. Maps to refineToolInput.

Value: IReadOnlyDictionary<string, Func<JsonElement, CancellationToken, Task<JsonElement>>>

View source

public ToolCallRepairFunction? RepairToolCall { get; init; }

Repairs a call whose tool is unknown or whose input is invalid. Maps to repairToolCall.

Value: ToolCallRepairFunction

View source

public GeneratedToolCall ToolCall { get; }

The call to parse.

Value: GeneratedToolCall

View source

public IReadOnlyList<Tool>? Tools { get; init; }

The available tools. Null means no tools were set, which differs from an empty list in the NoSuchToolError message.

Value: IReadOnlyList<Tool>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product