Skip to content

NoSuchToolError

Namespace: Vercel.AI.Util

public sealed class NoSuchToolError : AiSdkError, ISerializable, IErrorMarkers

The model called a tool that is not available. Maps to NoSuchToolError.

Inheritance: object → Exception → AiSdkError

Implements: ISerializable, IErrorMarkers

View source

NoSuchToolError(string, IReadOnlyList<string>?, string?)

Section titled “NoSuchToolError(string, IReadOnlyList<string>?, string?)”
public NoSuchToolError(string toolName, IReadOnlyList<string>? availableTools = null, string? message = null)

Creates the error. <code class=“paramref”>message</code> defaults to the upstream format.

Parameters

Name Type Description
toolName string
availableTools IReadOnlyList<string>
message string

View source

public const string ErrorMarker = "vercel.ai.error.AI_NoSuchToolError"

Marker for IsInstance(object).

Value: string

View source

public IReadOnlyList<string>? AvailableTools { get; }

Names of the available tools, or null when no tools were set.

Value: IReadOnlyList<string>

View source

public string ToolName { get; }

Name of the tool that was called.

Value: string

View source

public static bool IsInstance(object? error)

Returns whether <code class=“paramref”>error</code> carries this error’s marker.

Parameters

Name Type Description
error object

Returns: bool

View source

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