Skip to content

DocsQuestions and answers

2 min read · updated

Choose an option

Route or classify text using named options. Read the selected key and the probability of every alternative, then choose the action in your backend.

Use a choice question when your application knows the possible answers, such as the teams that can handle a support ticket. With a decisio server running, paste this request into a terminal:

curl --fail-with-body -sS --max-time 60 http://127.0.0.1:8000/v1/systemone \
-H 'Content-Type: application/json' \
-d '{
"state": "My card keeps getting declined when I renew.",
"questions": {
"category": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "Invoices, payments and refunds",
"access": "Login, passwords and permissions",
"bug": "The product behaves wrongly"
}
}
}
}'

Run against the CPU stand-in at v0.46.0 on 2026-11-13: the answers are the stand-in's, not the default model's.

Download the request as JSON to reuse it in your own client. This example uses the decisio endpoint; Ollama’s guide gives its port and required model name.

The key category names this question and its answer. The criteria object maps option keys to descriptions; the selected key is ready for your code to use.

OptionWhat belongs here
billingInvoices, payments and refunds
accessLogin, passwords and permissions
bugThe product behaves wrongly

Use descriptions to resolve overlap, such as a declined payment versus a sign-in failure. When the keys explain themselves, their descriptions can be null. If your inputs can fall outside the categories, add an option such as other and define when to use it.

Read answers.category.choice and answers.category.probabilities from the JSON response. For example, these are illustrative fields from one answer, with chosen probabilities rather than a measured model result:

{
"type": "choice",
"choice": "billing",
"probabilities": {"billing": 0.8, "access": 0.05, "bug": 0.15}
}

A shape to fill in, not a command to run.

choice is the key with the largest probability. The probabilities cover all supplied options and add up to 1, apart from rounding. Here, billing has probability 0.8, while the two alternatives together have probability 0.2.

Figure · A choice

One selected key, with the alternatives alongside it.

billing
0.80
access
0.05
bug
0.15

The selected key is billing, the largest probability. The other options still have a probability.

Illustration: chosen probabilities, using the tutorial request. Your model returns its own values.

Explore the request and answer fields

Figure · Illustrative field map

Find the field your code sends or reads.

Request

{
  "state": "My card keeps getting declined when I renew.",
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "billing": "Invoices, payments and refunds",
        "access": "Login, passwords and permissions",
        "bug": "The product behaves wrongly"
      }
    }
  }
}

Answer fields

{
  "answers": {
    "category": {
      "type": "choice",
      "choice": "billing",
      "probabilities": {
        "billing": 0.8,
        "access": 0.05,
        "bug": 0.15
      }
    }
  }
}

The text, question, options and typed answer are separate parts of one decision.

Read all field explanations
Text
state is the text to ask about. Keep it separate from the question.
Question
questions names each judgment. Its type and instructions tell the server what to answer.
Options
criteria gives named options for choice or ordered levels for score. A noul question already has yes and no, and can optionally describe true and false.
Answer
answers uses your question names. Read the typed value and its probabilities before your application acts.

Illustration: chosen probabilities, using the tutorial request. Your model returns its own values.

Your backend maps billing to its billing queue, access to its access queue and bug to its bug queue. Keep a review path for cases your routing policy does not accept, and check the HTTP status before reading any answer. Use the probabilities explains how to choose that policy and check it on labelled examples.

  • A choice accepts up to 255 options; more returns status 422.
  • Option order does not define a ranking. Use a score for levels from low to high.
  • Adding or changing options changes the question; evaluate the revised question before automating it.