Choice — picking one option in Jev
A Choice is one of the three question types in TypeSafe’s Jev model. It picks exactly one option from a set you define and returns the winner, a probability for every option, and a confidence value.
A Choice hands the model a named set of options and gets back exactly one of them. The option names are yours, so the answer is already a value your code can switch on — there is no string to normalise and no possibility of a name you never defined.
The interesting part is not the winner but the distribution that comes with it. Every option gets a probability, they sum to one, and the runner-up tells you what the model almost picked.
A real answer
Sent to jev-1.13.0. The numbers below are what came back.
Our SSO login has been throwing a 500 since the 4.2 release this morning. Nobody on the team can get in. Same on Chrome and Safari, two different tenants.
Which team should own this ticket?
Technical wins at 87%, but Account holds 13% — and that is the right disagreement to have, because an SSO failure really does sit on the line between the two. A bare label would have hidden it. If your routing has a cost for getting this wrong, 13% is the number to threshold on.
The request and the response, verbatim
{
"state": "Our SSO login has been throwing a 500 since the 4.2 release this morning. Nobody on the team can get in. Same on Chrome and Safari, two different tenants.",
"model": "jev-latest",
"questions": {
"queue": {
"type": "choice",
"instructions": "Which team should own this ticket?",
"criteria": {
"Billing": "Payments, invoices, refunds, plan changes",
"Technical": "Bugs, outages, API errors, integrations",
"Account": "Login, permissions, seats, data export",
"Sales": "Pricing, upgrades, contracts"
}
}
}
}{
"model": "jev-1.13.0",
"answers": {
"queue": {
"type": "choice",
"choice": "Technical",
"confidence": 0.83,
"probabilities": {
"Technical": 0.87,
"Sales": 0,
"Account": 0.13,
"Billing": 0
}
}
}
}What the answer contains
- type "choice"
- Matches the question type.
- choice string
- The highest-probability option.
- probabilities map<string, number>
- Every option you defined, mapped to its probability. They sum to 1.
- confidence number
- 0 to 1, computed from how the probabilities are spread. One clear peak is high confidence; a flat spread is low.
Rules and limits
-
criteriamaps each option to a description, or tonullwhen the name speaks for itself. - A Choice takes up to 255 options. Give the model the whole list of teams or categories rather than a shortlist — options cost only a few tokens each.
- Add an
OtherorNone of the aboveoption when your list might not cover every input, so the model has a way to say that none of them fit.
Reach for a Choice when
- The answers are a closed set you already have in code — queues, categories, statuses, next actions.
- You want to see the runner-up, not just the winner.
- You are routing, and the cost of each destination differs enough that you want to threshold per option.
Use something else when
- The options are ordered rungs of one scale — low, medium, high. A Score knows they are ordered and can land between them; a Choice treats them as unrelated labels.
- More than one option can be true at once. Ask a Noul per option instead.
The other two
Noul
A Noul is one of the three question types in TypeSafe’s Jev model. It asks a single yes/no question and answers with the probability that the answer is yes, as a number from 0 to 1.
Score
A Score is one of the three question types in TypeSafe’s Jev model. It rates the input against ordered levels you write and returns a probability-weighted value that can land between two levels.
Ask a Choice of your own text
The playground sends whatever you paste to Jev and draws every answer. No account, no key.
Open the playground