decide

public final static String decide(String stateJson, String questionsJson)

Calls the nutrient-document-decision model's native decision primitive directly: full caller control over both the shared state and the questions to answer against it. No document, schema, or template list is involved — this is the raw decision-model API for callers who want calibrated yes/no, multiple-choice, or ordinal-scale answers over their own structured state. The same concepts as llama.cpp's own /v1/systemone endpoint carry over (a shared state, and per-question type/instructions/options), but the concrete wire shape differs: questionsJson here is a JSON array with each question's id as a field, not an object keyed by id. usage.promptTokens is exact (summed from the native decode); there is no exact pre-call tokenizer, so budget roughly 1 token per 3-4 characters of rendered state/ instructions text (closer to 1 per 2.5-3 for JSON-heavy state) for cost estimates before calling.

Return

JSON: {"answers": {questionId: {type, chosenIndex, chosenKey, confidence, probabilities}}, "usage": {"promptTokens": N, "outputTokens": M}}.

Parameters

stateJson

The shared state every question is evaluated against: a JSON object, array, or plain string. Images are embedded inline as {"type":"image","source":"data:MIME-TYPE;base64,BASE64-DATA"} objects anywhere in the structure.

questionsJson

JSON array of questions, each {"id", "type": "noul"|"choice"|"score", "instructions", "options": [{"key", "description"}, ...]}. "noul" takes 0 options (default true/false wording) or exactly 2 ([true-option, false-option]); "choice"/"score" take 2+ options, each requiring a non-empty "key" for "choice" ("score" options are numbered by position instead).