ToolCallRepairContext
Namespace: Vercel.AI.GenerateText
public sealed class ToolCallRepairContextContext passed to a ToolCallRepairFunction. Maps to the options of ToolCallRepairFunction.
Inheritance: object
Constructors
Section titled “Constructors”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 |
Properties
Section titled “Properties”CancellationToken
Section titled “CancellationToken”public CancellationToken CancellationToken { get; }Cancels the repair. Maps to abortSignal.
Value: CancellationToken
public AiSdkError Error { get; }The NoSuchToolError or InvalidToolInputError raised while parsing the call.
Value: AiSdkError
InputSchema
Section titled “InputSchema”public Func<string, Task<JsonElement>> InputSchema { get; }Returns the JSON Schema of the input of the named tool.
Value: Func<string, Task<JsonElement>>
Instructions
Section titled “Instructions”public Instructions? Instructions { get; }The instructions given to the model.
Value: Instructions
Messages
Section titled “Messages”public IReadOnlyList<ModelMessage> Messages { get; }The messages of the current generation step.
Value: IReadOnlyList<ModelMessage>
System
Section titled “System”public Instructions? System { get; }Same as Instructions. Deprecated upstream; use Instructions.
Value: Instructions
ToolCall
Section titled “ToolCall”public GeneratedToolCall ToolCall { get; }The tool call that failed to parse.
Value: GeneratedToolCall
public IReadOnlyList<Tool> Tools { get; }The tools that are available.
Value: IReadOnlyList<Tool>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product