Choice
Pick one option from a list you define. You get the pick, a probability for every option and a confidence.
Shape
Question
{ "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 }}Answer
{ "type": "choice", "choice": "shipping", "confidence": 0.84, "probabilities": { "billing": 0.03, "shipping": 0.88, "account": 0.01, "other": 0.08 }, "stats": {}}choiceis the option with the highest probability (the first one listed, on a tie).probabilitieshas every option, in the order you listed them, and adds up to 1 (give or take rounding).confidencesays how far the pick stands above an even split; see Confidence.
Example
Request
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 } } } }'Response · 200
{ "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, notShipping & delivery team (EU)). Put the human description in the value. - The model reads both the name and the description, as
name: description. Anullor empty description means the name alone. - Make options cover everything that can arrive, with an
otherornoneoption 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.