from langchain_core.decisions import Choice, Noul, Score
from langchain_levanto import LevantoDecisionModel
sage = LevantoDecisionModel()
response = sage.invoke({
"state": "I was charged twice. Please refund the duplicate today.",
"questions": {
"refund": Noul(instructions="Is the customer asking for money back?"),
"team": Choice(
instructions="Which team should handle this?",
criteria={"billing": "Charges and refunds", "technical": "Bugs and outages"},
),
"urgency": Score(instructions="How urgent is it?", criteria=["Can wait", "This week", "Today"]),
},
})
response.nouls["refund"].noul # 0.996
response.choices["team"].choice # "billing"
response.scores["urgency"].score # 1.99, from 0 to 2