choice "billing"confidence 0.81
Request#
{
"route": {
"type": "choice",
"instructions": "Where should this go?",
"criteria": { "billing": "money", "bug": "broken", "account": "login" }
}
}type"choice"required- The question type.
criteriaobjectrequired- Option key to description, 1 to 255 options (two or more make a real choice). The keys are what comes back.
instructionsstring- What to decide.
Response#
{
"route": {
"type": "choice",
"choice": "billing",
"confidence": 0.81,
"probabilities": { "account": 0.05, "billing": 0.87, "bug": 0.08 }
}
}choicestring- The most likely option. Always one of the keys you sent.
probabilitiesobject- One entry per option, alphabetical by key. They sum to 1, up to rounding.
confidencenumber- How sure the model is, from 0 to 1. See the formula below.
How confidence is computed#
confidence = (K · p_max − 1) / (K − 1)
- K
- the number of options you sent
- p_max
- the probability of the chosen option
Confidence is 0 when every option is equally likely and 1 when one option has all the probability. For the route above, K is 3 and p_max is 0.87, so confidence is (3 × 0.87 − 1) / 2 = 0.81. It is computed from the unrounded probabilities. Because it rescales by K, a confidence of 0.8 means the same thing on a 3-way and a 10-way choice.