Scenarios
Scenarios
Six complete, runnable examples. Each one is a real decision, the questions behind it, and the plain code that acts on the answers.
Every scenario uses the same fictional company, Northwind, a B2B payments API, and the same pattern: declare the questions, ask them in one request, decide in code. The source for each lives in the examples directory of the library repository and runs with a key and one command.
Six fields per ticket, one request, and thresholds that depend on the plan.
Lead qualificationThe ideal customer profile is prose the revenue team owns.
ModerationPolicy as text, thresholds as a diffable object, hard rules in code.
RAG gateTwelve passages judged in one request, plus the question retrieval cannot answer.
Agent guardrailFive checks on every tool call, sharing one request.
Fraud reviewComposite scoring with your own weights, and confidence gating on the expensive path.
Running them#
git clone https://github.com/hakantapanyigit/jevascript
cd jevascript && npm install
echo 'JEV_API_KEY=apikey_...' > .env
npm run example examples/launch/01-ticket-triage.tsEach script prints the values it measured and the decision it reached, then the token count and cost of the run.
What they have in common#
- Propositions, not labels. Every
describe,conditionand criterion is a claim that can be true of the input. - One request per item. Schemas and
batch()keep everything about one input in one call. - Facts stay in code. Plan, price, amount, role: compared with
===and>, never asked. - The model's suggestion is one input. Where a schema includes an
actionfield, the code still applies hard policy on top of it.