PS5LM
d1 决策模型 Q8_0 · 4k ← 状态页

Decision model · cheat sheet

三种题型:是/否、单选、打分

d1 不写文字,它一次前向回答你列出的问题。所有问题放在 questions 里,每个问题只需要 type、instructions、criteria 三样东西。

POST /v1/systemone Base https://ps5.daheiai.cn/v1 model 字段随便填,会被忽略 当前无鉴权
noul

是 / 否

返回“为真”的概率

适合:是不是垃圾广告、有没有辱骂、是否需要人工、是否包含个人信息。返回的是 0–1 的概率,自己定阈值(常用 0.5)。

请求

{
  "state": "恭喜您中奖!点击链接领取 888 元红包。",
  "questions": {
    "spam": {
      "type": "noul",
      "instructions": "这是垃圾广告吗?"
    }
  }
}

返回

{
  "answers": {
    "spam": {
      "type": "noul",
      "noul": 0.982
    }
  },
  "usage": { "input_tokens": 38, "output_tokens": 0 }
}
choice

单选

从几个选项里选一个

适合:工单分流、内容分类、意图识别、页面类型判断。返回选中项、每个选项的概率和置信度。

请求

{
  "state": "包裹显示签收,但我根本没收到。",
  "questions": {
    "topic": {
      "type": "choice",
      "instructions": "这条消息属于哪一类?",
      "criteria": {
        "delivery": "物流、签收、丢件",
        "billing": "扣费、退款、发票",
        "technical": "应用或网站故障",
        "other": "其他"
      }
    }
  }
}

返回

{
  "answers": {
    "topic": {
      "type": "choice",
      "choice": "delivery",
      "probabilities": {
        "delivery": 0.949,
        "billing": 0.004,
        "technical": 0.009,
        "other": 0.038
      },
      "confidence": 0.939
    }
  }
}
score

打分

在有序等级上取期望值

适合:紧急程度、违规严重度、意向强度、质量评分。等级从低到高写 2–10 个。

请求

{
  "state": "再这样我就取消会员,并向银行申诉。",
  "questions": {
    "urgency": {
      "type": "score",
      "instructions": "这件事有多紧急?",
      "criteria": ["可以等", "本周内", "今天内", "正在阻塞客户"]
    }
  }
}

返回

{
  "answers": {
    "urgency": {
      "type": "score",
      "score": 1.96,
      "legend": {
        "0": "可以等",
        "1": "本周内",
        "2": "今天内",
        "3": "正在阻塞客户"
      },
      "probabilities": {
        "0": 0.05,
        "1": 0.24,
        "2": 0.43,
        "3": 0.29
      },
      "confidence": 0.378
    }
  }
}

组合示例:一次问完三种

问题彼此独立,一次前向完成

下面这条请求同时做了单选、是/否和打分。实测耗时约 0.4 秒。

curl https://ps5.daheiai.cn/v1/systemone \
  -H 'Content-Type: application/json' \
  -d '{
    "state": "客户留言:这个月被你们扣了两次款,订单号 A10293。我上周就发过邮件,到现在没人回复。再这样我就取消会员。",
    "questions": {
      "route": {
        "type": "choice",
        "instructions": "这条留言应该转给哪个团队?",
        "criteria": {
          "billing": "扣费、退款、发票",
          "technical": "应用或网站故障",
          "shipping": "物流与配送",
          "fraud": "疑似盗刷或未授权使用"
        }
      },
      "angry": {
        "type": "noul",
        "instructions": "客户是否明显生气?"
      },
      "urgency": {
        "type": "score",
        "instructions": "这件事有多紧急?",
        "criteria": ["可以等", "本周内", "今天内", "正在阻塞客户"]
      }
    }
  }'
怎么串起来用:先看 route.choice 决定派单队列;angry.noul 超过 0.8 时提醒主管;urgency.score 四舍五入到 2 以上就插队。三个判断互不影响,也不会多花时间。

速查表

typecriteria返回怎么判定
noul 可选:{"true": "...", "false": "..."} noul(0–1) >= 0.5 为是;高风险用 0.8
choice 必填:对象,每个选项一句描述 choice、probabilities、confidence 取 choice;confidence 低转人工
score 必填:数组,2–10 个等级,从低到高 score、legend、probabilities 四舍五入取整