DecisionResult
Defined in: src/decisions/types.ts:102
Result returned by DecisionModel.ask, keyed by the same identifiers as the input question map.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type | Description |
|---|---|---|
Q extends Record<string, Question> | Record<string, Question> | The question map passed to ask. |
Properties
Section titled “Properties”answers
Section titled “answers”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?
Section titled “usage?”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
Section titled “inputTokens”inputTokens: number;outputTokens
Section titled “outputTokens”outputTokens: number;totalTokens
Section titled “totalTokens”totalTokens: number;metadata
Section titled “metadata”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
Section titled “latencyMs”latencyMs: number;Time spent in the underlying model call, in milliseconds.
providerName?
Section titled “providerName?”providerName?: string;Provider that served the decision.
modelId?
Section titled “modelId?”modelId?: string;Provider-reported model identifier that served the decision.
probabilities?
Section titled “probabilities?”probabilities?: { readonly [K in string | number | symbol]: Readonly<Record<string, number>> };Per-question probability distributions, keyed by answer value.
confidence?
Section titled “confidence?”confidence?: { readonly [K in string | number | symbol]: number };Per-question confidence values in [0.0, 1.0].