Console ↗

Routing by confidence

Choose a queue and inspect its probability distribution. Evaluate a review cutoff on held-out tickets before routing automatically.

Input and workflow

Choose a review threshold using previously labeled tickets. Track accuracy and the share of cases that can be routed at that threshold.

Request

{
  "model": "ngila-judge",
  "state": "The last invoice includes two identical charges.",
  "questions": {
    "queue": {
      "type": "choice",
      "instructions": "Which team owns this issue?",
      "criteria": {
        "Billing": "",
        "Account access": "",
        "Technical support": ""
      }
    }
  }
}

Open request in Playground →

Run locally

Save ngila.py alongside your script and set NGILA_API_KEY. Save any linked input images in the same directory.

import json
from ngila import NgilaClient

state = 'The last invoice includes two identical charges.'
questions = {'queue': {'type': 'choice',
           'instructions': 'Which team owns this issue?',
           'criteria': {'Billing': '',
                        'Account access': '',
                        'Technical support': ''}}}

response = NgilaClient().system_one(state, questions)
a = response["answers"]
print(json.dumps(a, indent=2, ensure_ascii=False))

Use the answers

The following application fragment uses a = response["answers"]. Supply any thresholds, lookup tables, or previous results from your workflow before applying it.

route = a["queue"]
queue = route["choice"] if route["confidence"] >= threshold else "Review"

Browse cookbooks · System One request and response