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

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 charge
  • access — Account or login help
  • troubleshooting — Help with broken product behavior
  • cancel — Ending a subscription
  • other — 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

Limits and boundaries

Sources and inspiration

Continue

Browse all templates, learn the official SDK shape, or estimate production volume with the cost calculator.