Small decisions. Interesting possibilities.Submit contentSubmit

How it uses Jev

In the decision-model quickstart, a support message is the state for typed questions declared in Python return annotations. DecideStrategy compiles a bool or Enum (or a Pydantic model containing them) into one decision request, sends it through the configured DecisionClient, and rebuilds the declared return value. The triage example asks Jev to select a support department and decide whether the issue needs immediate action; application code reads those typed values and prints the triage result.

What Jev decides

Support-message triage (illustrative)Example answers · not a recorded Jev response · Source ↗
Question 1 · department
YOUR APP
INSTRUCTION

Select the team that owns the request.

STATE

The triage method receives message: "I was charged twice for my March invoice." DecideStrategy constructs state from that method parameter and the instruction to use only the supplied message.

JEV · CHOICE
  1. BILLING
  2. TECHNICAL
  3. ACCOUNT
Question 2 · urgent
YOUR APP
INSTRUCTION

Decide whether the request needs immediate action.

STATE

The triage method receives message: "I was charged twice for my March invoice." DecideStrategy constructs state from that method parameter and the instruction to use only the supplied message.

JEV · NOUL
YesNo

App workflow

  1. Configure the decision client

    Read the model, endpoint, and API key from DECISION_MODEL, DECISION_ENDPOINT, and OPENROUTER_API_KEY, with quickstart defaults for the model and endpoint. Pass the client to SupportRouter as its decision_model.

  2. Declare typed decisions

    Define the department Enum and its Criteria, then declare department, confident_department, and triage methods with DecideStrategy. Triage's Pydantic model declares both department Choice and urgent bool questions with instructions.

  3. Send each message

    For every sample message, call the three generated methods. Each call sends its own decision request; the triage method sends both fields in one request.

  4. Use typed answers and close the client

    Print the department and triage values. For the detailed department result, compare the selected option's probability with the 0.8 threshold and route low-probability cases to manual review. Close the DecisionClient in a finally block.

Why it is interesting

The framework turns ordinary Python types and field metadata into named, typed decision questions. One method can batch related questions into a single request, while an Enum and Criteria make the available choices and their meanings explicit in code. A separate detailed ChoiceDecision can retain probability evidence and apply a threshold before the application accepts a value.