Skip to content

DecisionResult

Defined in: src/decisions/types.ts:102

Result returned by DecisionModel.ask, keyed by the same identifiers as the input question map.

Type ParameterDefault typeDescription
Q extends Record<string, Question>Record<string, Question>The question map passed to ask.
answers: { [K in string | number | symbol]: AnswerOf<Q[K]> };

Defined in: src/decisions/types.ts:104

Per-question answer, statically narrowed from each question’s choices.


usage?: {
inputTokens: number;
outputTokens: number;
totalTokens: number;
};

Defined in: src/decisions/types.ts:106

Aggregate token usage for the underlying model call(s), when the provider reports it.

inputTokens: number;
outputTokens: number;
totalTokens: number;

metadata: {
latencyMs: number;
providerName?: string;
modelId?: string;
probabilities?: { readonly [K in string | number | symbol]: Readonly<Record<string, number>> };
confidence?: { readonly [K in string | number | symbol]: number };
};

Defined in: src/decisions/types.ts:112

Per-call metadata recorded by the implementation.

latencyMs: number;

Time spent in the underlying model call, in milliseconds.

providerName?: string;

Provider that served the decision.

modelId?: string;

Provider-reported model identifier that served the decision.

probabilities?: { readonly [K in string | number | symbol]: Readonly<Record<string, number>> };

Per-question probability distributions, keyed by answer value.

confidence?: { readonly [K in string | number | symbol]: number };

Per-question confidence values in [0.0, 1.0].