Confidence-gated routing
TypeSafe’s pattern page: use confidence as a second axis. The Choice tells you the intent. Confidence tells you whether your code is allowed to obey it. This page is for builders putting System One into production routing — unofficial notes, not TypeSafe support.
This page is for builders crossing from curious to production-minded Jev use. jev.pro is an independent unofficial field guide — not affiliated with TypeSafe AI. Cover intents; do not clone rival IA. Confirm facts on docs.typesafe.ai.
Voice banking example (theirs)
A voice command is classified into intents such as check_balance, approve_transfer, or other. Their illustrated policy:
- Confidence below 0.6 (any intent) → support agent.
check_balanceat ≥ 0.6 → show the balance (recoverable mistake).approve_transferabove 0.85 → approve.approve_transferbetween 0.6 and 0.85 → ask the user to confirm.- Other intents → human.
The confidence page uses a similar story with a 0.5 floor and 0.9 for transfers. The spread is the lesson: numbers are domain-specific illustrations, not shipped defaults.
Implementing it
action = response.answers["intent"]
if action.confidence < 0.6:
route_to_support_agent(account_id)
elif action.choice == "check_balance":
show_balance(account_id)
elif action.choice == "approve_transfer":
if action.confidence > 0.85:
approve_transfer(account_id)
else:
ask_user_to_confirm("Just to confirm: you would like to approve this transfer?")
else:
route_to_support_agent(account_id)
That snippet is adapted from the official pattern page. Tune thresholds on labeled traffic. For Nouls, gate on the probability (or its distance from 0.5), not on a missing confidence field.
Worked sketch: warehouse cancel-shipment
A floor-ops chat can cancel an outbound carton. Abstain on low confidence. Domain is logistics, not voice banking — cite confidence-gated routing; do not clone their mermaid.
{
"utterance": "Kill the FedEx on dock 3, the fashion drop, not the pharma tote.",
"wave": { "open_cartons": 2 }
}
| Id | Type | Options |
|---|---|---|
act |
Choice | lookup_carton / cancel_shipment / other |
act = answers["act"]
if act.confidence < 0.70: # illustration — fit on labels
return abstain("ops_review") # no WMS write
if act.choice == "lookup_carton":
return wms.lookup(...) # recoverable
if act.choice == "cancel_shipment":
if act.confidence > 0.90:
return wms.cancel(...) # irreversible
return confirm("Cancel the fashion carton on dock 3?")
return abstain("unmapped")
Same intent + two risk levels: lookup vs cancel. Confidence lives on Choice/Score only. Pin jev-1.13.0. Vendor $0.042 / M input (claim). Jaggedness: no generation of the confirm sentence if you can template it.
See triage thresholds for per-question-type floors and intent routing when the first cut is handler class.
Abstain is the production feature: a 0.68 cancel_shipment must not write the WMS. Confirm or queue. Log which floor fired (<0.70 vs >0.90) so ops can retune without rereading chat transcripts. Official 0.6 / 0.85 banking numbers remain illustrations.
When not to use
- Every action is equally cheap to undo — a single floor may suffice, or none.
- You need a Noul
confidencefield. It does not exist. - TypeSafe is down and the act is irreversible — fail closed (fallback).
See also
FAQ
Are 0.6 / 0.85 defaults?
No. Illustrations.
What if TypeSafe is down?
Fail closed on irreversible acts — fallback.
Intent + complexity in one call?
Yes. Official intent-routing mixes Choice and Score.
Does abstain return a 4xx?
No. Application outcome next to HTTP 200. See handoff.
Disclaimer
This is an independent unofficial site and is not affiliated with TypeSafe AI; official documentation is available at https://docs.typesafe.ai. Never treat jev.pro as TypeSafe official documentation. We do not sell, issue, or proxy API keys.