Skip to content

ToolCallRepairContext

Namespace: Vercel.AI.GenerateText

public sealed class ToolCallRepairContext

Context passed to a ToolCallRepairFunction. Maps to the options of ToolCallRepairFunction.

Inheritance: object

View source

ToolCallRepairContext(GeneratedToolCall, IReadOnlyList<Tool>, Func<string, Task<JsonElement>>, AiSdkError, IReadOnlyList<ModelMessage>, Instructions?, CancellationToken)

Section titled “ToolCallRepairContext(GeneratedToolCall, IReadOnlyList<Tool>, Func<string, Task<JsonElement>>, AiSdkError, IReadOnlyList<ModelMessage>, Instructions?, CancellationToken)”
public ToolCallRepairContext(GeneratedToolCall toolCall, IReadOnlyList<Tool> tools, Func<string, Task<JsonElement>> inputSchema, AiSdkError error, IReadOnlyList<ModelMessage> messages, Instructions? instructions, CancellationToken cancellationToken)

Creates a repair context.

Parameters

Name Type Description
toolCall GeneratedToolCall
tools IReadOnlyList<Tool>
inputSchema Func<string, Task<JsonElement>>
error AiSdkError
messages IReadOnlyList<ModelMessage>
instructions Instructions
cancellationToken CancellationToken

View source

public CancellationToken CancellationToken { get; }

Cancels the repair. Maps to abortSignal.

Value: CancellationToken

View source

public AiSdkError Error { get; }

The NoSuchToolError or InvalidToolInputError raised while parsing the call.

Value: AiSdkError

View source

public Func<string, Task<JsonElement>> InputSchema { get; }

Returns the JSON Schema of the input of the named tool.

Value: Func<string, Task<JsonElement>>

View source

public Instructions? Instructions { get; }

The instructions given to the model.

Value: Instructions

View source

public IReadOnlyList<ModelMessage> Messages { get; }

The messages of the current generation step.

Value: IReadOnlyList<ModelMessage>

View source

public Instructions? System { get; }

Same as Instructions. Deprecated upstream; use Instructions.

Value: Instructions

View source

public GeneratedToolCall ToolCall { get; }

The tool call that failed to parse.

Value: GeneratedToolCall

View source

public IReadOnlyList<Tool> Tools { get; }

The tools that are available.

Value: IReadOnlyList<Tool>

View source

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