Rank a small catalog of capabilities against a user request. Ask independently whether the selected capability is sufficient.
Input and workflow
A selected skill may need data the caller has not supplied. Use the second answer to request that input before enabling the skill.
Request
{
"model": "ngila-judge",
"state": "Make a scatterplot of revenue against customer count.",
"questions": {
"skill": {
"type": "choice",
"instructions": "Select the most relevant skill.",
"criteria": {
"Charting": "",
"Translation": "",
"Scheduling": ""
}
},
"needs_data": {
"type": "noul",
"instructions": "Does this task require numeric data?"
}
}
}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 = 'Make a scatterplot of revenue against customer count.'
questions = {'skill': {'type': 'choice',
'instructions': 'Select the most relevant skill.',
'criteria': {'Charting': '', 'Translation': '', 'Scheduling': ''}},
'needs_data': {'type': 'noul',
'instructions': 'Does this task require numeric data?'}}
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.
skill = a["skill"]["choice"]
check_data = a["needs_data"]["noul"] >= threshold