ChoiceResult interface

The selected option and probability distribution for a ChoiceQuestion.

Signature:

export declare interface ChoiceResult 

Properties

Property Type Description
confidence number Normalized probability in [0.0, 1.0] of the top-scoring option.
probabilities Record<string, number> Mapping from each candidate option string to its normalized probability.
rankedOptions Array<{ option: string; probability: number; index: number }> All candidate options ordered by descending probability.
selectedIndex number Zero-based index of the highest-probability option in the input options array.
selectedOption string The winning candidate option string with the highest probability.

ChoiceResult.confidence

Normalized probability in [0.0, 1.0] of the top-scoring option.

Signature:

confidence: number;

ChoiceResult.probabilities

Mapping from each candidate option string to its normalized probability.

Signature:

probabilities: Record<string, number>;

ChoiceResult.rankedOptions

All candidate options ordered by descending probability.

Signature:

rankedOptions: Array<{ option: string; probability: number; index: number }>;

ChoiceResult.selectedIndex

Zero-based index of the highest-probability option in the input options array.

Signature:

selectedIndex: number;

ChoiceResult.selectedOption

The winning candidate option string with the highest probability.

Signature:

selectedOption: string;