Skip to content

Docs

Choice

Pick one option from a set you define. Returns the option, the full probability distribution, and 0-1 confidence, with up to 255 options and parallel questions that barely add latency.
Format
Docs
Reading time
3 min
Published by
TypeSafe AI
Last verified
Sep 2026

Highlights

  • Option names and descriptions are both sent to the model; use null when a name speaks for itself.
  • An ambiguous ticket example reads returns 0.61 vs billing 0.35 with confidence 0.42.
  • Ask several Choice questions per call: they run in parallel and response time barely changes.
  • Chain choices level by level for deep hierarchies, as in the hierarchical classification cookbook.

Quickstart

python
Choice(
    instructions="Which team should handle this?",
    criteria={
        "returns": "Exchanges, wrong or damaged items",
        "shipping": "Delivery status, delays, lost packages",
        "billing": "Charges, invoices, payment problems",
    },
)

Watch out

Speculative questions still cost tokens even when your code ignores their answers, so weigh extra options against the input bill.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai