Skip to content

NoSuchModelError

Namespace: Vercel.AI.Util

public class NoSuchModelError : AiSdkError, ISerializable, IErrorMarkers

A provider has no model with the requested id. Maps to NoSuchModelError.

Inheritance: object → Exception → AiSdkError

Implements: ISerializable, IErrorMarkers

Derived: NoSuchProviderError

View source

public NoSuchModelError(string modelId, string modelType, string? message = null)

Creates the error. <code class=“paramref”>modelType</code> is a name such as languageModel.

Parameters

Name Type Description
modelId string
modelType string
message string

View source

NoSuchModelError(string, string, string, string)

Section titled “NoSuchModelError(string, string, string, string)”
protected NoSuchModelError(string errorName, string modelId, string modelType, string message)

Creates the error with a subclass error name.

Parameters

Name Type Description
errorName string
modelId string
modelType string
message string

View source

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

Marker for IsInstance(object).

Value: string

View source

public string ModelId { get; }

Requested model id.

Value: string

View source

public string ModelType { get; }

Requested model type, such as languageModel.

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