Console ↗

Self-consistency for choices

Measure how often a category assignment changes across repeated evaluations.

Input and workflow

Repeat the exact request over a labeled set. Log agreement separately from accuracy; a category can remain stable and still be wrong.

Request

{
  "model": "ngila-judge",
  "state": "The customer asks whether a replacement charger has shipped.",
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "Which queue handles the request?",
      "criteria": {
        "Shipping": "",
        "Warranty": "",
        "Billing": "",
        "Other": ""
      }
    }
  }
}

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 customer asks whether a replacement charger has shipped.'
questions = {'category': {'type': 'choice',
              'instructions': 'Which queue handles the request?',
              'criteria': {'Shipping': '',
                           'Warranty': '',
                           'Billing': '',
                           'Other': ''}}}

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.

changed = a["category"]["choice"] != previous["category"]["choice"]

Browse cookbooks · System One request and response