from krun import Krun, NoulQuestion, ScoreQuestion
client = Krun()
result = client.decide(
context="Customer says this is the third time exports failed and wants a human immediately.",
questions={
"department": {"type": "choice", "options": {"billing": "", "support": "", "sales": ""}},
"needs_human": NoulQuestion("Is the customer asking for human assistance?"),
"severity": ScoreQuestion(
"How severe is the reported issue?",
["Minor issue", "Feature degraded", "Blocking issue"],
),
},
)
department = result.choice("department").choice # "support"
needs_human = result.noul("needs_human").noul # 0.94
severity = result.score("severity").score # 1.62