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: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.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?”
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.
3. jev_score — how much, on a ladder
Lowest rung is index 0. score: 3 means “the fourth item”, not “3 out of 5”.
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.
questions (a JSON object, usually as a string):
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.
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’sstate 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.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
- Jev examples
- Jev as
Agent.model— same three helpers, no chat - Jev as an eval judge — score a chat agent in
@agentium/eval - Docs index
- TypeSafe introduction
- TypeSafe JS SDK