Skip to content
Questions

Choice

Pick one option from a list you define. You get the pick, a probability for every option and a confidence.

Shape

{  "type": "choice",  "instructions": "…",               // optional: the question  "criteria": {                      // required: 1 to 255 options    "option_name": "what it covers", // a description…    "other": null                    // …or null for the name alone  }}
{  "type": "choice",  "choice": "shipping",  "confidence": 0.84,  "probabilities": { "billing": 0.03, "shipping": 0.88, "account": 0.01, "other": 0.08 },  "stats": {}}
  • choice is the option with the highest probability (the first one listed, on a tie).
  • probabilities has every option, in the order you listed them, and adds up to 1 (give or take rounding).
  • confidence says how far the pick stands above an even split; see Confidence.

Example

curl -s "https://api.vakyn.com/v1/systemone" \  -H "Authorization: Bearer $TYPESAFE_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "jev-latest",    "state": "Tracking has shown my parcel as out for delivery for four days and it still has not arrived.",    "questions": {      "team": {        "type": "choice",        "instructions": "Which team should answer this message?",        "criteria": {          "billing": "Charges, invoices and refunds",          "shipping": "Delivery, tracking and damaged parcels",          "account": "Sign-in, password and profile",          "other": null        }      }    }  }'
Try it in the playground
{  "model": "vakyn-fake",  "answers": {    "team": {      "type": "choice",      "choice": "shipping",      "confidence": 0.84,      "probabilities": {        "billing": 0.03,        "shipping": 0.88,        "account": 0.01,        "other": 0.08      },      "stats": {}    }  },  "usage": {    "input_tokens": 49,    "output_tokens": 0  },  "assets_used": null}

Writing options

  • Option names come back in your code, so use stable identifiers (shipping, not Shipping & delivery team (EU)). Put the human description in the value.
  • The model reads both the name and the description, as name: description. A null or empty description means the name alone.
  • Make options cover everything that can arrive, with an other or none option when they might not. Otherwise the model has to force a fit and the probabilities spread out.
  • Keep options exclusive. If two can both be true, a choice question will split probability between them; ask a noul per option instead.
  • A question may have up to 255 options. For long lists (product categories, intents), describe each option briefly and consider a two-step route: a coarse choice first, then a fine one.

A choice with a single option is allowed and always answers that option with probability 1 and confidence 1.

Loading the docs…