from typesafe_sdk import Choice, Noul, Score, TypeSafeClient client = TypeSafeClient() # reads TYPESAFE_API_KEY, defaults to jev-latest ticket = ( "Since this morning my laptop won't connect to the corporate network. " "Home Wi-Fi works fine. I have a board presentation in 40 minutes." ) response = client.system_one( state=ticket, questions={ "category": Choice( instructions="Which category best describes the root issue", criteria={ "wifi": "Wireless connectivity problems", "vpn": "VPN or remote-access tunnel problems", "hardware": "Physical device or peripheral failure", "auth": "Login, password, MFA or certificate problems", "other": "Anything else", }, ), "severity": Score( instructions="Business impact of this issue", criteria=[ # ordered: index 0 = lowest "Cosmetic, no work blocked", "Degraded, workaround exists", "Blocked, single user", "Blocked, time-critical or many users", ], ), "time_sensitive": Noul( instructions="The user has a hard deadline within the next few hours", ), }, ) cat = response.answers["category"] print(cat.choice, round(cat.confidence, 2)) print(cat.probabilities) # full distribution print(response.answers["severity"].score) # e.g. 3.0 print(response.answers["time_sensitive"].noul) # e.g. 0.97