ai icon indicating copy to clipboard operation
ai copied to clipboard

`experimental_decide`: export answer validation so stored or corrected answers can be checked the same way

Open robelest opened this issue 1 week ago • 1 comments

experimental_decide checks a model's answers in validateDecisionAnswers (src/decide/): a choice's distribution covers every option and sums to 1, the choice is a highest-probability option, a score equals the probability-weighted mean, and a box has left < right and top < bottom, all within the declared rounding. None of it is exported.

Apps that store decisions and let a person correct an answer need the same checks, so a corrected answer is one experimental_decide would have accepted. Today they have to copy the rules and the tolerance, which then drift from the SDK.

Could ai export validateDecisionAnswers, or an equivalent that checks one answer against its question and optional rounding?

Seen in [email protected].

robelest avatar Nov 27 '26 02:11 robelest

Identify issue type

Identified as Feature
Confidence: High

Rationale

The issue requests a new public validation API, not a fix for incorrect existing SDK behavior.

Evidence

  • Requests exporting the internal validateDecisionAnswers function or an equivalent public validator.
  • Apps currently must copy validation rules and tolerances to check stored or human-corrected answers.

ai-sdk-factory[bot] avatar Nov 27 '26 02:11 ai-sdk-factory[bot]