Lesson 11 · path 5
SDK labs: JavaScript and Python
Install the JavaScript or Python SDK. Send one document plus a Choice, a Noul, and a Score in a single call. Then pick a model.
JavaScript
npm install @typesafe-ai/sdk
The SDK is like a coffee machine. You don't grind the beans and boil the water yourself. You press a button. Same idea here: you call ready-made functions instead of writing raw HTTP requests.
import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const response = await client.systemOne({
state: { document: "I was charged twice. Please fix this ASAP." },
questions: {
category: choice("What is this ticket about?", {
billing: "Payments, charges, refunds",
technical: "Bugs or integrations",
other: "Anything else",
}),
urgent: noul("Does this convey urgency?"),
frustration: score("How frustrated is the customer?", [
"Calm",
"Frustrated",
"Very angry",
]),
},
});
That call sends one support ticket and three questions. A Choice picks the category. A Noul checks urgency. A Score rates frustration. One call to System One, three answers back.
Do not set dangerouslyAllowBrowser: true on public academy pages (JS SDK).
Python
pip install typesafe-sdk
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
with TypeSafeClient() as client:
response = client.system_one(
state={"document": "I was charged twice. Please fix this ASAP."},
questions={
"billing": Noul(instructions="Is this ticket about billing?"),
"tone": Choice(
instructions="What is the customer's tone?",
criteria={"calm": None, "frustrated": None, "angry": None},
),
"urgency": Score(
instructions="How urgent is this ticket?",
criteria=["can wait", "this week", "today"],
),
},
)
Same idea in Python. One ticket, three questions, one system_one call.
Models: prefer jev-latest. It's an alias, so the exact model behind it can change. Pin jev-1.13.0 when you need stable thresholds (Models). Optional extra: the Agent skill.
Next
Capstone labs and the use-case gallery.