DecisionResult
Defined in: src/decisions/types.ts:95
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:97
Per-question answer, statically narrowed from each question’s choices.
usage?
Section titled “usage?”optional usage?: { inputTokens: number; outputTokens: number; totalTokens: number;};Defined in: src/decisions/types.ts:99
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;};Defined in: src/decisions/types.ts:105
Per-call metadata recorded by the implementation.
latencyMs
Section titled “latencyMs”latencyMs: number;Time spent in the underlying model call, in milliseconds.