Branch
Pick one subtree out of several, with a no-match outcome and a confidence floor.
LIVE DEMO →which chart answers the questionBranch asks a Choice question and renders the matching child. It is the right primitive when the options are unordered and exactly one should win.
<Branch
ask="Which view best answers the question in `data.question`?"
data={{ question }}
minConfidence={0.5}
onResolved={(cost) => console.log(cost.shareUsd)}
>
<Option k="line" when="The question is about a trend across many time periods.">
<LineChart />
</Option>
<Option k="table" when="The question needs exact per-row numbers.">
<Table />
</Option>
<Option fallback>
<Table />
</Option>
</Branch>Props
How it becomes a question
When the fallback renders
- Confidence is below minConfidence — the model reports it is not sure, so do not act on a guess.
- The model picked the no-match option, meaning none of your options fit the state.
- The judgment failed outright. The failure is recorded and visible in the Inspector rather than swallowed.
Low confidence on a Choice often means no option is a clear winner, not that the model is broken. Several acceptable alternatives spread probability too — a harmless preference does not need a high floor.