support · basic
Refund Detection
Identify whether a support case is primarily asking for money back, without turning classification into refund authorization.
choicenoul
When to use it
- Support triage
- Billing queues
- Refund review intake
Example state
{
"latest_message": "I was charged twice for order A-1042. Please reverse one charge.",
"order_id": "A-1042",
"settled_charges_count": 2,
"previous_refund": false
}Decision questions
choiceprimary_request
What is the customer's primary request?
refund— Money back or reversing a chargeaccess— Account or login helptroubleshooting— Help with broken product behaviorcancel— Ending a subscriptionother— None of the above
noulrefund_request_supported
Does the supplied message and order state support that the customer is asking for a refund or charge reversal?
Expected structured output
A typed primary_request label plus a probability for whether the evidence supports a refund request.
TypeScript example
import { choice, noul, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const result = await client.systemOne({
state: {
latest_message:
"I was charged twice for order A-1042. Please reverse one charge.",
order_id: "A-1042",
settled_charges_count: 2,
previous_refund: false,
},
questions: {
primary_request: choice("What is the customer's primary request?", {
refund: "Money back or reversing a charge",
access: "Account or login help",
troubleshooting: "Help with broken product behavior",
cancel: "Ending a subscription",
other: "None of the above",
}),
refund_request_supported: noul(
"Does the supplied evidence support that the customer is asking for a refund or charge reversal?"
),
},
});
console.log(result.answers);Why this design works
- The classification space is closed and operationally useful.
- The state separates what the customer said from order facts.
- The extra Noul question preserves uncertainty instead of forcing every case into an action.
Limits and boundaries
- Detecting a refund request does not authorize a refund.
- Actual refund eligibility should be checked by deterministic policy and payment records.
Sources and inspiration
This template and its source links were last reviewed on 2026-09-21.
Continue
Try this pattern in the Jev Playground, browse all templates, learn the official SDK shape, or estimate production volume with the cost calculator.