回复置信度闸门
使用“回复置信度闸门”模板,决定草拟的回复是自动发送(≥ 0.85)、进入审核队列(0.4–0.85)还是交给人工(< 0.4)。
目标: 自动发送明显没问题的回复,审核处于边界的回复,其余的交给人工——阈值清晰可见、可以修改。
创建决策
模板 → 回复置信度闸门 → 创建决策:
| 部分 | 内容 |
|---|---|
| 状态 | customer_message、draft_reply(字符串,必填) |
ready_to_send | probability——这份草稿能否无需人工检查就发出? |
answers_question | probability——它是否回答了客户的问题? |
promises_something | probability——它是否承诺了退款、折扣、期限或特殊例外? |
| 策略 | ready_to_send < 0.4 → escalate;promises_something ≥ 0.7 且 ready_to_send < 0.95 → escalate;ready_to_send 的置信度 < 0.5 → escalate |
| 目的地 | auto_send——≥ 0.85 时调用 sendReply;review_queue——0.4 到 0.85 时调用 queueForReview;hand_to_human——escalate 时调用 assignToHuman |
调用
curl -X POST https://api.dcision.io/v1/decisions/reply-confidence-gate \
-H "Authorization: Bearer $DCISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": {
"customer_message": "How do I change the email on my account?",
"draft_reply": "Go to Settings → Account, click Edit next to your email, confirm the code we send to the new address and you're done."
}
}'{
"schema": "reply-confidence-gate",
"result": { "ready_to_send": 0.93, "answers_question": 0.96, "promises_something": 0.03 },
"action": "continue",
"destinations": [{ "key": "auto_send", "type": "function", "function": "sendReply", "params": { "reply": "Go to Settings → Account, …" } }]
}据此行动
const handlers = { sendReply, queueForReview, assignToHuman };
for (const d of decision.destinations ?? []) if (d.type === "function") await handlers[d.function](d.params);调优
- 调整阈值(0.85 和 0.4),它们位于目的地和第一条规则中;概览会根据你的历史记录给出校准建议。
- 把函数换成 webhook 或工作流,将审核队列直接接入 n8n、Make 或 Zapier。
- 把你的政策写进
context,让promises_something知道你的团队可以承诺什么。