CJev Primitive

Jev Choice

Jev Choice picks one option from a fixed set. It is designed for routing, classification, and selection — the bounded decisions where an LLM would be overkill and code alone is not enough.

What Choice does

You define a set of options — for example, five support teams, three priority levels, or four content categories. You give Jev the input (a ticket, a message, a document). Jev reads the input and returns one option from your set.

The return value is typed. Your code receives a string or enum it can switch on immediately. No parsing, no JSON extraction, no retry loop. The decision is bounded: Jev can only return one of the options you defined.

When to use Choice

  • Routing. Send a ticket, message, or request to one of several teams or queues.
  • Classification. Categorize content into one of several types — spam, promotional, transactional.
  • Selection. Pick the best option from a known set — which template, which response, which action.
  • Priority assignment. Assign one of several priority levels to an issue or task.

When not to use Choice

  • Open-ended answers. If the set of possible answers is unknown, Choice is the wrong tool.
  • Yes/no questions. Use Noul instead — it is purpose-built for binary decisions.
  • Ordered scales. If the options have a clear ordering (low, medium, high), use Score.
  • Deterministic rules. If you can write the routing logic as code, do that instead.

Writing options and criteria

Each option in a Choice should be distinct and testable. If two options overlap, the decision will be unreliable — Jev might pick either one for the same input.

Write criteria for each option that explain when it should be chosen. These criteria become part of your Decision Spec and help you validate the decision later.

If none of the options fit, define a qualitative fallback — for example, "Other" routes to human review, asking for more information, or an LLM fallback. Do not invent a confidence threshold.

Example: support ticket routing

You have five support teams: Billing, Technical, Account, Sales, and General. A new ticket arrives. Jev Choice reads the ticket and returns one team name.

Decision Spec (excerpt)Choice
{
  "type": "choice",
  "question": "Which team should handle this ticket?",
  "options": [
    "billing",
    "technical",
    "account",
    "sales",
    "general"
  ],
  "fallback": "general → human review"
}

Choice in a Decision Spec

A Choice Decision Spec includes the question, the input fields, the list of options, the criteria for each option, and the fallback. Jev Fit + Builder generates this spec as editable JSON, so you can refine the options and criteria before generating code.

The code shape

After generating the spec, you get implementation-ready code in TypeScript, Python, and cURL. The code shape is simple:

TypeScript
const result = await jev.choice({
  question: "Which team should handle this ticket?",
  input: { ticket_text: ticket.body },
  options: ["billing", "technical", "account",
            "sales", "general"],
});

switch (result.value) {
  case "billing": routeToBilling(ticket); break;
  case "technical": routeToTechnical(ticket); break;
  // ...
  default: routeToHuman(ticket); // fallback
}

Choice, Noul, or Score?

Choice

This one. Pick one from a set of unordered options.

Noul

Answer a yes/no question.

Score

Rate on an ordered scale.

Try it on your workflow

Describe a routing task and the analyzer will identify Choice steps.

Analyze a routing workflowWhen to use Jev
FAQ

Frequently asked questions

It's a Jev primitive that returns exactly one option from a fixed set. It's designed for routing, classification, and selection.

Still have questions?

Contact support@jevmodel.co →