choicedepartmentWhich team should handle this ticket?
billingtechnicalsales
Support operations
Route a support ticket, score urgency, and detect refund intent in one typed-decision call.
Use Laya as a fast decision layer before a helpdesk workflow, human queue, or larger language model.
I was charged twice for invoice 441 and nobody has answered for three days. Refund the duplicate today or we are cancelling our plan.
choicedepartmentWhich team should handle this ticket?
scoreurgencyHow urgent is this request?
noulrefund_requestedDoes the customer explicitly request a refund?
from laya import Router
router = Router(preload=True)
state = {
"body": "I was charged twice for invoice 441 and nobody has answered for three days. Refund the duplicate today or we are cancelling our plan."
}
questions = {
"department": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "payments, invoices, refunds",
"technical": "bugs and outages",
"sales": "pricing and contracts"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"criteria": ["low", "medium", "high", "critical"]
},
"refund_requested": {
"type": "noul",
"instructions": "Does the customer explicitly request a refund?"
}
}
print(router.predict(state, questions))import { Laya } from "@receptron/laya";
const laya = await Laya.load();
const result = await laya.systemOne(
{ body: "I was charged twice. Refund the duplicate today." },
{
department: {
type: "choice",
instructions: "Which team should handle this ticket?",
criteria: { billing: "payments and refunds", technical: "bugs and outages", sales: "pricing and contracts" },
},
urgency: { type: "score", instructions: "How urgent is this request?", criteria: ["low", "medium", "high", "critical"] },
refund_requested: { type: "noul", instructions: "Does the customer explicitly request a refund?" },
},
);
console.log(result.answers);
await laya.close();