← All recipesRouting / PYTHON

Classification with a parent-category fallback

Choose a broad category first, then refine it. When uncertain, keep the request at the broader level.

Up to 2 API requestsInputs: fictional, EnglishExternal actions: 0
01 / WORKFLOW

What the model decides. What code checks.

  1. The first Choice selects the technical or operations category. An unknown answer or low confidence goes straight to human review.
  2. The second request contains only children of the selected category. Other branches are never called.
  3. Code returns a specific queue or the parent queue flagged for review. Unknown routes are never executed.
02 / LOCAL EXECUTION

Read. Run. Replay.

Unpack the archive and open its directory in a terminal. The first step needs neither a key nor a network connection.

1 · offline plan · 0 API requests
python3 runner.py hierarchical-routing

For a real run, set SHVYDKO_API_KEY in your computer or server environment. Do not put the key in your browser or source code. Current account quotas and pricing apply.

2 · explicit live run
python3 runner.py hierarchical-routing --live --output hierarchical-routing-run.json

The report contains requests, actual responses, elapsed times, and known usage. The file is created with private permissions and never overwrites an existing file. Network failures are not automatically retried: check Usage before another call.

3 · replay saved responses · 0 API requests
python3 runner.py hierarchical-routing --replay hierarchical-routing-run.json

Replay checks that the recipe, inputs, and requests match. A local file is editable, so it is not signed proof of where responses came from. If you replace the inputs with your own data, the report will contain those data too: keep it private.

03 / REQUEST PLAN

An open contract, with every step visible.

The plan below was generated by the same runner from the bundled fixtures. It contains requests and author expectations, not model results.

offline-plan.json
{
  "mode": "offline_plan",
  "model_calls": 0,
  "recipe": "hierarchical-routing",
  "author_expectation": [
    "technical",
    "checkout"
  ],
  "notice": "Requests only, no model answers. Hierarchy includes conditional branches; repetition requests are templates.",
  "requests": [
    {
      "state": "Every card checkout shows a payment gateway timeout. Cash on delivery still works. No card was charged.",
      "questions": {
        "category": {
          "type": "choice",
          "instructions": "Choose the top-level support category.",
          "criteria": {
            "technical": "Website, payment integration or access failures",
            "operations": "Shipping or review of a charged payment",
            "unknown": "No category fits"
          }
        }
      }
    },
    {
      "state": {
        "message": "Every card checkout shows a payment gateway timeout. Cash on delivery still works. No card was charged.",
        "parent": "technical"
      },
      "questions": {
        "subcategory": {
          "type": "choice",
          "instructions": "Choose the specific issue within this parent, or unknown.",
          "criteria": {
            "checkout": "Checkout or payment integration failure",
            "access": "Login or account access failure",
            "unknown": "Not enough evidence"
          }
        }
      }
    },
    {
      "state": {
        "message": "Every card checkout shows a payment gateway timeout. Cash on delivery still works. No card was charged.",
        "parent": "operations"
      },
      "questions": {
        "subcategory": {
          "type": "choice",
          "instructions": "Choose the specific issue within this parent, or unknown.",
          "criteria": {
            "shipping": "Shipment or delivery question",
            "charged_payment": "Refund or invoice for a payment already charged",
            "unknown": "Not enough evidence"
          }
        }
      }
    }
  ]
}