unhardcoded
编排路由调用

工作流

五种工作流模式,每种都是由策略路由步骤构成的有界图,生成一条完整的追踪记录。

工作流

五种常见结构。每个标签页展示流程图及本示例中各步骤路由到的模型;点击查看 flow_ir 可获取完整可复制的项(term)。建议先用 POST /x/flow/normalize 进行演练。每个节点声明自身策略(filter + rank),图表中的模型 ID 与成本展示真实路由结果——内部值保持英文。

低成本分类,按质量下限起草,再经过一个强力 no-log 守卫在发送前进行审核——若有问题可拒绝输出。图表中每个节点各自执行策略决策,"已排除"表示未通过筛选的候选,"已解析 · 运行"表示被选中的模型。

查看 flow_ir
flow.support-ticket.json
["flow", {
  "u": {"kind": "input"},
  "t": {"kind": "llm", "system": "Classify the ticket and extract the account id as JSON.",
    "policy": ["policy", ["and", ["meets_req"], ["not", ["is", "disabled"]], ["has_cap", "supports_json_mode"]],
      ["neg", ["normalize", ["field", "price_out"]]], ["argmax"], ["id"], ["always", {"action": "next_candidate"}]],
    "inputs": ["u"]},
  "d": {"kind": "llm", "system": "Write a reply using the ticket and the triage.",
    "policy": ["policy", ["and", ["meets_req"], ["not", ["is", "disabled"]], ["cmp", "bench_intelligence", "ge", 0.55]],
      ["neg", ["normalize", ["field", "price_out"]]], ["argmax"], ["id"], ["always", {"action": "next_candidate"}]],
    "inputs": ["u", "t"], "template": "Ticket:\n$1\n\nTriage:\n$2"},
  "g": {"kind": "llm", "system": "Check brand voice, PII, refund limits. Refuse if any fail.",
    "policy": ["policy", ["and", ["meets_req"], ["not", ["is", "disabled"]], ["is", "no_log"]],
      ["field", "bench_intelligence"], ["argmax"], ["id"], ["always", {"action": "next_candidate"}]],
    "inputs": ["d"]},
  "out": {"kind": "output", "inputs": ["g"]}
}]
← 返回文档