> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quackpay.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Route support requests

> Build a support classification workflow with Goldenfish choices and a safe fallback.

This guide turns incoming support text into a small action vocabulary. The example returns a choice your application can map to a queue or next step; it does not send a reply to the customer.

## Define the action vocabulary

Start with a small set of mutually exclusive actions:

```text theme={null}
reset_password
billing
cancel_account
technical_issue
```

Keep the values stable and machine-readable. Your user-facing labels can live in your application.

## Send the request

```bash cURL theme={null}
curl https://api.aspaslabs.com/v1/decisions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "goldenfish-g1",
    "input": "I was charged twice for the same order.",
    "instruction": "Which support action applies?",
    "choices": [
      "reset_password",
      "billing",
      "cancel_account",
      "technical_issue"
    ]
  }'
```

## Map the result

Read `output.choice` and map it to an internal action:

```javascript theme={null}
const actions = {
  reset_password: { queue: "identity", next: "send_reset_flow" },
  billing: { queue: "billing", next: "open_billing_case" },
  cancel_account: { queue: "retention", next: "offer_cancelation" },
  technical_issue: { queue: "technical", next: "collect_diagnostics" }
};

const action = actions[decision.output.choice];
if (!action) {
  // Treat an unknown choice as a contract failure, not as a safe default.
  throw new Error("Unknown Goldenfish choice");
}
```

The API returns probabilities for every choice. Record them when you need to evaluate the classifier, but do not expose raw scores to end users unless that is part of your product design.

## Add a fallback

Choose a policy before shipping:

* Send low-confidence decisions to human review.
* Add a `needs_review` choice if it is a real product outcome.
* Retry only for transport failures or temporary `503` responses, not for a valid low-confidence result.
* Keep the original input, decision ID, model, and request ID in your audit record when your privacy policy permits it.

<Warning>
  Never silently route an unknown or missing choice to a destructive action. Validate the returned value against the choices you sent before executing side effects.
</Warning>

## Evaluate before production

Build a test set from representative support requests and label the expected action. Track:

* Accuracy by choice.
* Low-confidence rate.
* Confusion between similar choices.
* The percentage routed to human review.
* Changes after a model or catalog revision.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.