kind. The kind sets how you list the outcomes and what the answer holds.
A decision with no
kind is single.
The examples below are the three decisions of the quickstart’s request, each with the
answer kettei-core gave to it, rounded to three places.
Binary
Usebinary for a question whose answer is yes or no.
outcomesis optional. When you send it, its keys areyesandno, each with a description of when it applies.probabilities.yesis the probability that the answer is yes.- Ask the question the positive way round. “Does the ticket state a deadline?” is easier to answer and to label than “Is this not urgent?”.
Single
Usesingle to pick one of several outcomes that exclude each other, such as a team, a category or a
tool.
- List the outcomes as names, such as
["billing", "technical", "sales"], or as a map from each name to a description of when it applies. Descriptions help most where two outcomes meet. - A decision has 2 to 255 outcomes, and their names differ.
abstainis reserved for the abstain policy. - If none of your outcomes might fit, add one such as
otherornone.
Ordinal
Useordinal for a level on an ordered scale, such as severity or quality.
outcomeslists the levels in order, lowest first.rubricdescribes each level, in the same order. An ordinal decision needs both.expected_levelis the average level, weighted by the probabilities. It counts positions from 0, not the values of your labels: on alow,medium,highscale it runs from 0 to 2.- Sort a queue by
expected_level, or usetopas a label.
Mix kinds in one request
One request can ask decisions of every kind about the same context, as the quickstart does. Each decision gets its own probabilities, and its own action if you give it a policy. The answers come back keyed byid.
Rules every decision follows
- A request asks 1 to 128 decisions. A model may take fewer:
max_questionsin/v1/models, which a fine-tuned model shares with the model it was trained from. - Keep outcome names short and put the detail in descriptions. If several decisions in a request have an outcome name over 500 characters, they must all list the same outcomes in the same order. Send other decisions in a request of their own.
- Keep the order of the outcomes fixed when you reword a decision, and when you fine-tune a model on it.
- A decision that breaks a rule is refused with
422 invalid_request, anderror.detailsnames the field.
