Question types
noul, choice and score - what each one asks and what it returns.
Every question has a type, optional instructions, and criteria whose shape depends on the type.
| Field | Type | Meaning |
|---|---|---|
type | "noul", "choice", "score" | Required |
instructions | any JSON value, usually a string | The question itself |
criteria | depends on the type | The possible answers and what each means |
Probabilities are rounded to four decimals.
noul
A yes or no question. The answer is one number: the probability of yes.
{
"wants_refund": {
"type": "noul",
"instructions": "Is the customer asking for a refund?"
}
}{ "wants_refund": { "type": "noul", "noul": 0.0213 } }criteria is optional. Use it to say what counts as yes and what counts as no, under the keys true and false:
{
"is_sandwich": {
"type": "noul",
"instructions": "Is `food` a sandwich?",
"criteria": {
"true": "A filling such as meat, cheese or vegetables is placed between slices of bread.",
"false": "There is no bread enclosing a filling, or the wrapper is not bread: a tortilla, a wafer, a cookie."
}
}
}choice
One of the options you name. criteria is an object: each key is an option's name, each value describes when it
applies. A request can have 1 to 255 options.
{
"team": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "Payments, invoices, refunds, subscriptions.",
"technical": "Bugs, errors, outages, integration problems.",
"sales": "Pricing questions, upgrades, new purchases.",
"other": "Anything that fits none of the above."
}
}
}{
"team": {
"type": "choice",
"choice": "technical",
"confidence": 0.9467,
"probabilities": { "billing": 0.021, "technical": 0.96, "sales": 0.008, "other": 0.011 }
}
}| Field | Meaning |
|---|---|
choice | The most likely option |
probabilities | A probability for every option, by name. They sum to 1 |
confidence | How far the top option stands above chance: (p_max - 1/K) / (1 - 1/K) for K options. 0 when all options are equally likely, 1 when one is certain |
A description may be null or an empty string; the option is then judged by its name alone.
score
A position on an ordered scale. criteria is a list of level descriptions, from the lowest to the highest (1 to
255 levels).
{
"severity": {
"type": "score",
"instructions": "How severe is this alert?",
"criteria": [
"Informational. Nothing for anyone to do.",
"Minor. Look at it during working hours.",
"Serious. Customers notice; act today.",
"Critical. Page the on-call engineer now."
]
}
}{
"severity": {
"type": "score",
"score": 2.1,
"confidence": 0.62,
"legend": {
"0": "Informational. Nothing for anyone to do.",
"1": "Minor. Look at it during working hours.",
"2": "Serious. Customers notice; act today.",
"3": "Critical. Page the on-call engineer now."
},
"probabilities": { "0": 0.01, "1": 0.12, "2": 0.63, "3": 0.24 }
}
}| Field | Meaning |
|---|---|
score | The expected level: the sum of level × probability. Levels are counted from 0, so a four-level scale gives a number from 0 to 3 |
probabilities | A probability for every level, by its index as a string |
legend | The level descriptions by index, as the model read them |
confidence | 1 when all the probability is on one level, 0 when it is spread as widely as a uniform distribution. Measured as the expected distance from the most likely level |
Use score when the options have an order (severity, quality, urgency). For options with no order, use choice:
an expected value over unordered options means nothing.
Which type to use
| You want to know | Use |
|---|---|
| Whether something is true | noul |
| Which one of several named things | choice |
| How much, on a scale you define | score |
| Several independent labels (tags) | One noul per label, in one request |