客服 · 基础

客服路由

将收到的客服消息路由到一个主要队列,并评估需要多快处理。

ChoiceScore

适合什么时候使用

  • 工单路由
  • 队列优先级
  • 客服自动化

示例 state

{
  "message": "My card was charged, but the upgrade never appeared.",
  "customer_plan": "Starter",
  "payment_status": "settled"
}

决策问题

Choicequeue

为这个案例选择主要客服队列。

  • billing — 支付、发票或扣款问题
  • account — 账户、访问权限或权益问题
  • technical — 产品行为或技术故障
  • cancellation — 取消订阅
  • other — 无法明确判断主要类别
Scoreurgency

把处理紧急度评为 0 到 3。

  1. 0 — 常规,没有时间敏感影响
  2. 1 — 影响较小
  3. 2 — 正在影响客户
  4. 3 — 严重或必须立即处理的客户影响

预期输出

一个主要队列,以及紧急度评分。

TypeScript 示例

import { choice, score, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();

const result = await client.systemOne({
  state: {
    message: "My card was charged, but the upgrade never appeared.",
    customer_plan: "Starter",
    payment_status: "settled",
  },
  questions: {
    queue: choice("Choose the primary support queue.", {
      billing: "Payment, invoice, or charge issue",
      account: "Account, access, or entitlement issue",
      technical: "Product behavior or technical failure",
      cancellation: "Subscription cancellation",
      other: "None is clearly primary",
    }),
    urgency: score("Score review urgency.", [
      "Routine",
      "Minor impact",
      "Active customer impact",
      "Severe or time-critical impact",
    ]),
  },
});

为什么这样设计

  • 主要路由指令能处理一个案例可能同时符合多个队列的情况。
  • 紧急度等级提前定义好,不让模型自己发明评分标准。

注意事项

  • 路由不应静默丢弃次要问题。
  • 紧急度只用于排队和分流,不等于 SLA 承诺。

来源与参考

这个模板和来源链接最近核验:2026-09-21

继续浏览

先在Playground中运行这个模式,浏览全部模板,了解官方 SDK 用法,或使用成本计算器估算实际使用成本。