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"]}
}]
← 返回文件