Skip to main content

Questions

A question tells Super Decider what to decide about the state. Each question has a type, and the type fixes the shape of the answer, so your code never has to parse free text.

Anatomy of a question​

On the /v1/systemone endpoint, questions is an object. Each key is the question's id, and the id is also the key of its answer in the response.

"questions": {
"next_step": {
"type": "choice",
"instructions": "What should support do next?",
"criteria": {
"refund_now": "Refund without a return",
"start_return": "Start a return",
"escalate": "Hand over to a human"
}
}
}
FieldDescription
typechoice, score, noul, span or spans.
instructionsThe question, in plain language.
criteriaThe allowed answers. Its shape depends on the type.

Question ids must be unique within a request and can't be empty or contain : or a line break.

Question types​

TypeUse it tocriteriaAnswer
choicePick one option from a fixed setObject: option name → description, or nullchoice, probabilities, confidence
scoreRate against ordered levelsArray of levels, lowest firstscore, legend, probabilities, confidence
noulAnswer yes or noOptional: {"true": "...", "false": "..."}noul, the probability of yes
spanQuote one piece of the stateOptional: {"max_tokens": n}found, text, start, end, confidence, coverage
spansQuote every matching pieceOptional: {"max_tokens": n, "max_items": n}found, items

Choosing a type​

  • Is it yes or no? Use a noul. "Is this message spam?", "Does the invoice total match?"
  • Do the answers have an order? Use a score. "How urgent is this?" with low, medium, high. The expected level lets you set thresholds between levels.
  • Are the answers separate categories? Use a choice. "Which team owns this ticket?", "Which tool should the agent call?"
  • Do you need the exact words from the input? Use a span. "What is the order number?", "Quote the clause that sets the notice period."

Before you reach for a choice with options like yes, no and unsure, consider a noul: its probability already tells you how unsure the model is.

Ask several questions at once​

A request can carry up to 64 questions. The model fills every answer in one step, so a request with ten questions costs little more than a request with one, and much less than ten requests.

Group the questions you need about one state into one request. You can also add questions you might not need: see speculative fan-out.

Writing good questions​

Ask one thing per question. "Is the customer angry and asking for a refund?" mixes two decisions. Split it into two nouls.

Describe the options. A short description per option, such as "escalate": "Hand over to a human", tells the model where the boundaries are. A bare name is fine when it is unambiguous.

Leave a way out. If a case may fit none of the options, add one such as other or escalate. Otherwise the model must pick the least-wrong option.

Keep the options in a fixed order. Answers can shift when the same options are listed in a different order. Define each question once in code and reuse it.

Put shared context in the state or in top-level instructions. A policy that several questions depend on belongs in the state, or in the request's top-level instructions field, not repeated in each question's instructions.

Name ids for what they mean. Question ids appear in the prompt, so refund_eligible is better than q3. Still put the full question in instructions.

Several labels can apply? Ask one noul per label instead of one choice, because a choice always picks exactly one option.

Chat completions shape​

The chat completions endpoint takes the same questions in a slightly different shape: a questions array with an id on each question, options for a choice and levels for a score.

{"questions": [
{"id": "next_step", "type": "choice", "instructions": "What should support do next?",
"options": [{"name": "refund_now", "description": "Refund without a return"},
{"name": "start_return", "description": "Start a return"},
{"name": "escalate", "description": "Hand over to a human"}]},
{"id": "allowed", "type": "noul", "instructions": "Is cancelling this order allowed by the policy?"},
{"id": "urgency", "type": "score", "instructions": "How urgent is this ticket?",
"levels": ["low", "medium", "high"]}
]}