Skip to content

DecisionQuestion

Namespace: Vercel.AI.Operations

public class DecisionQuestion

One decision question. Maps to DecisionModelV4Question.

Inheritance: object

Derived: EvaluationQuestion

View source

DecisionQuestion(string, DecisionInput?, DecisionCriteria?)

Section titled “DecisionQuestion(string, DecisionInput?, DecisionCriteria?)”
public DecisionQuestion(string type, DecisionInput? instructions, DecisionCriteria? criteria = null)

Creates a question.

Parameters

Name Type Description
type string choice, score, boolean, or box.
instructions DecisionInput Instructions as a string, JSON object, or JSON array. A box question requires them. The other types may leave them null when the provider supports it and the criteria define the judgment.
criteria DecisionCriteria DecisionChoiceCriteria for a choice, DecisionScoreCriteria for a score, and an optional DecisionBooleanCriteria for a boolean. A box question has no criteria.

View source

public DecisionCriteria? Criteria { get; }

Choice options, ordered score levels, or optional boolean descriptions. A box question has no criteria.

Value: DecisionCriteria

View source

public bool HasInstructions { get; init; }

True when instructions is present. It is true whenever Instructions is set. Set it to true with null instructions to send an explicit null, as upstream does for instructions: null. A question that leaves it false omits the field, as upstream does for an absent or undefined value.

Value: bool

View source

public DecisionInput? Instructions { get; }

Instructions. A string, JSON object, or JSON array. May be null for choice, score, and boolean questions.

Value: DecisionInput

View source

public string Type { get; }

choice, score, boolean, or box.

Value: string

View source

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