Skip to content

DecisionRefusalError

Namespace: Vercel.AI.Util

public sealed class DecisionRefusalError : AiSdkError, ISerializable, IErrorMarkers

A decision model refused one or more questions.

Inheritance: object → Exception → AiSdkError

Implements: ISerializable, IErrorMarkers

View source

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

Section titled “DecisionRefusalError(IReadOnlyList<string>, string, string, string?)”
public DecisionRefusalError(IReadOnlyList<string> questionIds, string provider, string modelId, string? message = null)

Creates the error for the refused questions.

Parameters

Name Type Description
questionIds IReadOnlyList<string>
provider string
modelId string
message string

View source

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

Marker for IsInstance(object).

Value: string

View source

public string ModelId { get; }

Decision model id.

Value: string

View source

public string Provider { get; }

Decision provider id.

Value: string

View source

public IReadOnlyList<string> QuestionIds { get; }

Refused question ids, in question order.

Value: IReadOnlyList<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