Skip to content

DecisionModels

Namespace: Vercel.AI.Operations

public static class DecisionModels

Resolves decision models, including string model ids. Maps to resolveDecisionModel.

Inheritance: object

View source

public const string MissingProviderMessage = "The default provider does not support decision models."

Message thrown when the default provider has no decision models.

Value: string

View source

public static ProviderBase? DefaultProvider { get; set; }

The global default provider (AI_SDK_DEFAULT_PROVIDER). A string model id is resolved through it. It must implement IDecisionProvider or the deprecated IEvaluationProvider. When null, string ids go through Gateway.

Value: ProviderBase

View source

public static Func<GatewayProvider>? GatewayFactory { get; set; }

Creates the provider used when DefaultProvider is null. Null uses a shared GatewayProvider.

Value: Func<GatewayProvider>

View source

public static IDecisionCaller Resolve(IDecisionCaller? model, string? modelId)

Resolves a decision model. <code class=“paramref”>model</code> wins when set. Otherwise <code class=“paramref”>modelId</code> goes through DefaultProvider, or Gateway when none is set.

Parameters

Name Type Description
model IDecisionCaller
modelId string

Returns: IDecisionCaller

View source

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