openinstinctdocs

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.

FieldTypeMeaning
type"noul", "choice", "score"Required
instructionsany JSON value, usually a stringThe question itself
criteriadepends on the typeThe 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.

Question
{
  "wants_refund": {
    "type": "noul",
    "instructions": "Is the customer asking for a refund?"
  }
}
Answer
{ "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.

Question
{
  "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."
    }
  }
}
Answer
{
  "team": {
    "type": "choice",
    "choice": "technical",
    "confidence": 0.9467,
    "probabilities": { "billing": 0.021, "technical": 0.96, "sales": 0.008, "other": 0.011 }
  }
}
FieldMeaning
choiceThe most likely option
probabilitiesA probability for every option, by name. They sum to 1
confidenceHow 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).

Question
{
  "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."
    ]
  }
}
Answer
{
  "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 }
  }
}
FieldMeaning
scoreThe expected level: the sum of level × probability. Levels are counted from 0, so a four-level scale gives a number from 0 to 3
probabilitiesA probability for every level, by its index as a string
legendThe level descriptions by index, as the model read them
confidence1 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 knowUse
Whether something is truenoul
Which one of several named thingschoice
How much, on a scale you definescore
Several independent labels (tags)One noul per label, in one request

On this page