state and a map of questions. The keys of the map are your own IDs, and the answers use the same IDs.
The state is a string, or a JSON object or list. Nimble reads a JSON state as JSON text.
Noul
Anoul question asks whether a statement is true. The answer’s noul field is the probability that it is true, from 0 to 1.
criteria. This is optional.
Choice
Achoice question asks which option fits best. criteria maps each option key to a description. A question has 2 to 255 options. If a description is null, Nimble reads the key instead.
choice is the option with the highest probability. probabilities gives every option, and they add up to 1.
Score
Ascore question asks where the state falls on a scale. criteria lists the levels from lowest to highest. A question has 2 to 255 levels.
score is the expected level, counting from 0. It can fall between two levels. legend maps each level number to its text.
Confidence
choice and score answers have a confidence field. It is 1 when one option has all the probability, and 0 when every option is equally likely. It is not the chance that the answer is right.
Tips
- Ask many questions in one request. Nimble reads the state once for all of them, so this is faster than one request per question.
- Pick clear question IDs and option keys. Nimble reads them as part of the prompt, so renaming one can change its answer.
- Set your own threshold on
noul, e.g., act only when it is above 0.8.