Decision::get() returns an Answers collection. Decision::response() returns the full DecisionResponse envelope. Both terminal methods use the same lazy execution path.
Read answers by question ID
Use the typed accessor when the expected primitive is known:noul(), choice(), and score() reject a missing ID and reject an answer of the wrong primitive. answer($id) returns the NoulAnswer|ChoiceAnswer|ScoreAnswer union when generic processing is intentional. Collections also expose all(), count(), and toArray().
Interpret each result
NoulAnswer
NoulAnswer::probability() is the probability of yes. confidence() derives the
winning-side confidence as max(p, 1 - p); it is not stored as a second source of
truth. Treat values near 0.5 as uncertainty and choose application thresholds
based on the cost of false positives and false negatives.
ChoiceAnswer
value() is always one of the option IDs supplied by the request. probabilities() contains the full normalized distribution over those exact IDs. Confidence describes how concentrated the judgment is; it is not a guarantee that the selected option is correct.
ScoreAnswer
value() is the probability-weighted index across the ordered levels and therefore may be fractional. probabilities() is indexed from 0; legend() preserves the corresponding level definitions. Polyglot validates that the distribution, expected value, and legend agree with the original question.
Inspect optional model signals
Every answer exposessignals(). A provider such as Laya can attach a typed
modelActionProbability() without forcing application code to parse its raw
response:
Use the response envelope
totalTokens() is available only when both input and output counts are present. responseData() exposes the underlying normalized HTTP response for diagnostics; keep business logic on typed answers instead of provider bodies.
For an estimate, look up the exact returned model in
Decision\Models\ModelCatalog and pass its optional pricing plus this usage to
Decision\Pricing\FlatRateCostCalculator. The calculator returns null when
required paid usage is unknown; an explicitly zero-priced category does not
require a count.
Lazy and memoized execution
create() returns PendingDecision without making a network call. The first get() or response() executes it, and later calls return the memoized result. Terminal failures are memoized too.