Console ↗

Verify generated answers

Ask whether a draft is grounded in the supplied evidence. Check completeness separately from factual agreement.

Input and workflow

Check the boundary condition separately from general factual support. Here, “under six” and “six and under” differ by an entire age group.

Request

{
  "model": "ngila-judge",
  "state": {
    "source": "Admission is free for children under six.",
    "draft": "Children aged six and under enter free."
  },
  "questions": {
    "accurate": {
      "type": "noul",
      "instructions": "Does the source support the full age range in the draft?"
    },
    "same_policy": {
      "type": "noul",
      "instructions": "Do the age cutoffs match exactly?"
    }
  }
}

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 = {'source': 'Admission is free for children under six.',
 'draft': 'Children aged six and under enter free.'}
questions = {'accurate': {'type': 'noul',
              'instructions': 'Does the source support the full age range in '
                              'the draft?'},
 'same_policy': {'type': 'noul',
                 'instructions': 'Do the age cutoffs match exactly?'}}

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.

weakest = min(a[k]["noul"] for k in ("accurate", "same_policy"))

Browse cookbooks · System One request and response