模型回答之后
Jev 这类决策模型能读懂客户的一段话,给出判断和置信度。退不退款、要不要人工看,还要看金额、期限和你们的政策,这一步写在规则里。
退款分流规则包
if jev.confidence > 0.85:
refund(order)这一行决定谁能拿回钱。它通常没经过 review,也没有测试,模型一升级,0.85 的含义就变了。
Jev 能读懂客户想退款,但它不知道你们的退款期限、金额上限,也不知道多大把握才敢不经人工直接退钱。这一步是决策,交给 Ordo。
退款请求怎么处理,写成一张决策表:
config:
name: refund
version: 1.0.0
entry_step: route
steps:
route:
id: route
name: 退款怎么处理
type: decision_table
inputs: [jev.intent.choice, jev.intent.confidence, order.amount, order.days_since_delivery]
outputs: [action]
rules:
- when: ["*", "*", "*", "> 30"]
then: [HUMAN_REVIEW]
- when: [refund, ">= 0.85", "<= 200", "*"]
then: [AUTO_REFUND]
- when: [refund, ">= 0.6", "*", "*"]
then: [LLM_DRAFT]
default: [HUMAN_REVIEW]
next_step: done
done:
id: done
name: 完成
type: terminal
result:
code: OK
output:
- [action, $action]$ ordo exec --rule refund.yaml --input '{"jev":{"intent":{"choice":"refund","confidence":0.72}},
"order":{"amount":129,"days_since_delivery":1}}'
code: OK
output: {
"action": "LLM_DRAFT"
}Jev 有 0.72 的把握客户想退款,规则认为这还不够直接动钱,所以让 LLM 起草回复,再由客服确认。改门槛只需要改这张表,再跑一遍测试,调用方的代码不用动。
有人提议把自动退款的门槛从 0.85 降到 0.80。在 jev-routing 规则包里改完,12 个测试全部通过。ordo impact 把改动和上一个提交放在一起跑:
$ ordo impact refund-routing
impact refund-routing (HEAD → working tree)
309 inputs: 12 tests, 0 captured, 297 boundary probes
LLM_DRAFT → AUTO_REFUND 18 inputs
LLM_DRAFT → HUMAN_REVIEW 3 inputs
…
21 changed · 288 unchanged测试都过了,但有 18 个原本要人确认的请求,现在没人看就直接退钱了。加上 --inputs 用真实请求跑一遍,看到的就是真实客户的数量,而且是在改动上线之前。