サポート · basic
返金依頼の検出
顧客が返金を求めているかを識別し、分類結果を返金承認と混同しない例です。
choicenoul
使用する場面
- Support triage
- Billing queues
- Refund review intake
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
}判断の質問
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?
期待される出力
A typed primary_request label plus a probability for whether the evidence supports a refund request.
TypeScript
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);この設計の理由
- 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.
注意点
- Detecting a refund request does not authorize a refund.
- Actual refund eligibility should be checked by deterministic policy and payment records.
公式ソース
2026-09-21
次のステップ: Jev Playground、テンプレート。