The Three Primitives
Choice is a match statement, Score is a sort key, Noul is an if. Compose all three against one state in the builder.
Three primitives cover everything Jev does, and each maps onto a construct you already use in code. A Choice is a match statement. A Score is a sort key. A Noul is an if.
Choice
Pick one option from a set you define at request time, up to 255 of them. You get the winning option, the full probability distribution, and a confidence value.
from typesafe_sdk import Choice, TypeSafeClient
client = TypeSafeClient()
response = client.system_one(
state=ticket,
questions={
"department": Choice(
instructions="Which team should handle this",
criteria={
"billing": "Payment or subscription issues",
"technical": "Bugs or integration problems",
"sales": "Pricing or account questions",
},
),
},
)Score
An ordered scale of two to ten levels. The returned score is an expectation over the distribution, which means it can land between levels: a 0.57/0.43 split across levels 1 and 2 returns 1.43. Useful for ranking, dangerous if you read it as a measurement.
Noul
A single truth value between 0 and 1. Short for Bernoulli. It returns no confidence field, and that is not an oversight: a two-outcome distribution is fully described by the one number.