Skip to content

Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.

2.5 KB
Raw Blame
// Generated by scripts/decision-contracts.py from the canonical v1 examples.
export const protocolExamples = {
  "first": {
    "request": {
      "latest_user": [
        {
          "kind": "text",
          "text": "把这段说明改成三条清晰的要点。"
        }
      ],
      "visible_conversation": [],
      "history_partial": false,
      "route": {
        "kind": "smart_saving",
        "groups": [
          "regular",
          "primary"
        ]
      },
      "preceding_stage": null
    },
    "response": {
      "group": "regular"
    }
  },
  "assessment": {
    "request": {
      "latest_user": [
        {
          "kind": "text",
          "text": "请逐项核对这篇稿件的来源与因果论断,给出审稿意见。"
        }
      ],
      "visible_conversation": [
        {
          "user": [
            {
              "kind": "text",
              "text": "检查这篇文章的事实和因果论断。"
            }
          ],
          "status": "completed",
          "steps": [
            [
              {
                "kind": "text",
                "text": "已完成审稿,但遗漏了没有证据支持的因果断言。"
              }
            ]
          ]
        }
      ],
      "history_partial": false,
      "route": {
        "kind": "branches",
        "categories": [
          {
            "id": "writing",
            "condition": "撰写、续写或改写文章,包括根据反馈修稿。",
            "groups": [
              "regular",
              "primary"
            ]
          },
          {
            "id": "review",
            "condition": "审阅、核实文章并提出意见,不直接重写全文。",
            "groups": [
              "regular",
              "primary"
            ]
          }
        ],
        "default_category": "writing"
      },
      "preceding_stage": {
        "from": 0,
        "category": "review",
        "group": "regular",
        "complete": true
      }
    },
    "response": {
      "group": "primary",
      "category": "review",
      "assessment": {
        "score": 0.35,
        "partial": false
      },
      "reason": "Previous review stage needs primary protection"
    }
  }
};
export function protocolCurl(example: keyof typeof protocolExamples): string {
  return `curl --request POST 'https://classifier.example/v1/decisions' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '${JSON.stringify(protocolExamples[example].request, null, 2).replaceAll("'", "'\\''")}'`;
}