Intro to Jev · 4One call, three questions
ticket.ts
import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const { answers } = await client.systemOne({
state: "I was charged twice for my payment, reply by today!",
questions: {
department: choice("Which team should handle it?", {
billing: "Payments or subscriptions",
technical: "Bugs or integration issues",
sales: "Pricing or sales questions",
}),
frustration: score("How frustrated is the customer?", [
"Calm, states the facts",
"Frustrated but polite",
"Very angry",
]),
urgent: noul("The message needs action today"),
},
});
answers
answers.department.choice
"billing"
typed as a union of your options
answers.frustration.score
1.04
weighted average of the levels: ~ "polite"
answers.urgent.noul
0.92
probability of "yes"
One call, three typed answers.