DecisionLanguageModel
Namespace: Vercel.AI.Operations
public sealed class DecisionLanguageModel : IEvaluationDecisionCaller, IDecisionCaller, IEvaluationCallerAdapts structured language-model output to Choice, Score, and Boolean decisions. Maps to DecisionLanguageModel.
Inheritance: object
Implements: IEvaluationDecisionCaller, IDecisionCaller, IEvaluationCaller
Constructors
Section titled “Constructors”DecisionLanguageModel(ILanguageModel, string?)
Section titled “DecisionLanguageModel(ILanguageModel, string?)”public DecisionLanguageModel(ILanguageModel model, string? provider = null)Wraps a language model. The provider id defaults to {model.Provider}.decision.
Parameters
| Name | Type | Description |
|---|---|---|
model |
ILanguageModel | |
provider |
string |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version. Only v4 is accepted.
Value: string
SupportedQuestionTypes
Section titled “SupportedQuestionTypes”public IReadOnlyList<string> SupportedQuestionTypes { get; }Question types this model can answer.
Value: IReadOnlyList<string>
Methods
Section titled “Methods”Deserialize(DecisionLanguageModelOptions)
Section titled “Deserialize(DecisionLanguageModelOptions)”public static DecisionLanguageModel Deserialize(DecisionLanguageModelOptions options)Restores a model from Serialize(DecisionLanguageModel). Maps to [WORKFLOW_DESERIALIZE].
Parameters
| Name | Type | Description |
|---|---|---|
options |
DecisionLanguageModelOptions |
Returns: DecisionLanguageModel
DoDecideAsync(DecisionModelCall, CancellationToken)
Section titled “DoDecideAsync(DecisionModelCall, CancellationToken)”public Task<DecisionModelResult> DoDecideAsync(DecisionModelCall call, CancellationToken cancellationToken = default)Answers every question with one structured-output model call.
Parameters
| Name | Type | Description |
|---|---|---|
call |
DecisionModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<DecisionModelResult>
DoEvaluateAsync(EvaluationModelCall, CancellationToken)
Section titled “DoEvaluateAsync(EvaluationModelCall, CancellationToken)”[Obsolete("Use DoDecideAsync instead.")]public Task<EvaluationModelResult> DoEvaluateAsync(EvaluationModelCall call, CancellationToken cancellationToken)Deprecated. Use CancellationToken).
Parameters
| Name | Type | Description |
|---|---|---|
call |
EvaluationModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<EvaluationModelResult>
Serialize(DecisionLanguageModel)
Section titled “Serialize(DecisionLanguageModel)”public static DecisionLanguageModelOptions Serialize(DecisionLanguageModel model)Serializes the wrapped model and the provider id for a workflow boundary. Maps to [WORKFLOW_SERIALIZE].
Parameters
| Name | Type | Description |
|---|---|---|
model |
DecisionLanguageModel |
Returns: DecisionLanguageModelOptions
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product