Skip to main content

Jev

What this toolkit does

Your agent is still Claude or GPT. It talks to the user. It writes the reply. When it needs a judgment — “is this urgent?”, “which team?”, “how bad is it?” — it calls a Jev tool. Jev is a decision model. It does not write sentences. It returns a label, a yes/no probability, or a score. Think of it like a calculator, but for decisions:
You do not have to write the questions in your code first. The chat model can invent them at call time (jev_choose, jev_noul, jev_score, jev_ask). Or you lock the questions in a pack so the model only picks a pack name (jev_evaluate).
Need JSON answers and no chat at all? Skip this toolkit. Use jev() as the model instead: agent.run(ticket, { questions }).

Setup


The smallest example

Hand the tools to any chat agent. Tell it when to call them.
That one new JevToolkit() adds four tools: jev_choose, jev_noul, jev_score, jev_ask.

The four tools (no packs)

Every tool takes state — the text (or JSON string) Jev should judge. Usually that is the user’s message.

1. jev_choose — pick one label

“Which bucket does this belong in?”
What the model sends:
What Jev sends back (the model reads this JSON):
choice is the winning label. confidence is how sure Jev is (0–1). Tell the chat model to treat low confidence as “ask a human”.

2. jev_noul — yes or no, as a number

Noul = how true is this? 0 is no. 1 is yes. 0.5 is a coin flip. Not a boolean.
What the model sends:
What Jev sends back:

3. jev_score — how much, on a ladder

Lowest rung is index 0. score: 3 means “the fourth item”, not “3 out of 5”.
What the model sends:
What Jev sends back:
1 = "low". Put that in the instructions so the chat model does not say “severity 1/5”.

4. jev_ask — several questions in one go

One TypeSafe call. Same state. Cheaper and faster than three separate tools.
What the model sends as questions (a JSON object, usually as a string):
What Jev sends back — your keys, not generic names:
You can add a hint on each choice label:

Packs — you write the questions, the model only picks a name

If you do not want the chat model inventing questions, put them in packs. That adds a fifth tool: jev_evaluate. The model can only pass pack: "ticket" and the text. It cannot change the questions inside.
Two packs on one toolkit:
You can write a pack as JSON instead of choice / noul / score. Same result:

More copy-paste examples

Support inbox

Refund gate (yes/no only)

Route + page with a pack

Judge a draft before send

JSON state (richer than a raw string)

Any tool’s state can be a JSON string. Jev parses {...} / [...].

Chat agent + Jev + another toolkit

Jev is just another tool. Slack / HTTP / your own tools still work.

Config (all optional)

string
TypeSafe key. Falls back to TYPESAFE_API_KEY.
string
API root. Falls back to TYPESAFE_BASE_URL.
string
default:"jev-latest"
jev-latest (today jev-1.13.0) or a pin. Same ids as jev().
object
Named question sets. Adds jev_evaluate. Write them with choice / noul / score, or as { type, question, options | levels }.

How to read an answer

state is text, or JSON if it starts with { or [. Bad JSON stays text. Unknown pack name: Unknown pack "x". Available: ticket, moderation — it does not throw.

Toolkit vs jev() as the model


See also