Skip to navigation

Decision Questions

View as Markdown

For the integration flow and a request example, read Decision Model-Related Protocols. For result interpretation and provider response mappings, continue to Decision Answers.

System One is a common API for open decision models, including Jev. SystemOneClient uses /v1/systemone; OpenAiDecisionClient uses /v1/decisions. Both accept DecisionRequest.

Request fields

Protocol field and typeMeaningSystem OneOpenAI Decisions
DecisionRequest.model: Option<ModelId>Selected decision model. The HTTP adapters require it before sending.modelmodel
DecisionRequest.input: ValueShared conversation, application state, or other material to evaluate.JSON-valued stateText-valued input; structured values are serialized as JSON text
DecisionRequest.questions: BTreeMap<String, DecisionQuestion>Independent questions keyed by stable IDs.questions object, keyed by IDquestions[], with each ID in name
DecisionQuestion.instructions: ValueInstructions for one question.JSON-valued instructionsText-valued instructions; structured values become JSON text
DecisionQuestion.kind: DecisionKindExpected Boolean, choice, or rubric-score answer.Question type and criteriaQuestion type, with choices or levels where applicable

Question IDs identify the answers. Preserve them through conversion; an array position alone is not a replacement for an ID. Input is shared across the request, while each question has its own instructions.

Question kinds

Kind and fieldsContractSystem OneOpenAI Decisions
DecisionKind::Boolean with true_description: Option<Value> and false_description: Option<Value>Ask for a Boolean judgment or probability of true. Descriptions define the two answers when needed.type: "noul"; descriptions in criteria.true and criteria.falsetype: "predicate"; descriptions are included in instruction text because there are no separate fields
DecisionKind::Choice with options: Vec<ChoiceOption>Declare a nonempty list of options with unique IDs, preserving their order in the protocol.type: "choice"; criteria maps option IDs to descriptionstype: "choice"; choices[] carries value and optional description
DecisionKind::Score with levels: Vec<Value>Declare at least two levels, ordered low to high and indexed from zero.type: "score"; criteria is the level arraytype: "score"; levels[].label carries each level’s text
ChoiceOption.id: StringStable ID used by the selected answer and any distribution.Key in criteriachoices[].value
ChoiceOption.description: Option<Value>Optional meaning when the ID alone is insufficient.JSON-valued description; absent description becomes nullText description when supplied; structured values become JSON text

Choice questions can contain more than two options. A score is a position on the declared rubric, including fractional positions; it is not an arbitrary numeric measurement. Keep the question’s levels when interpreting the answer.

Construction and validation

The fields are public. Constructing or deserializing a DecisionRequest does not enforce all question contracts. Supply a selected model for HTTP calls, valid option IDs, and a correctly ordered rubric. The adapters apply their format-specific checks; they are not a general validation layer for every possible backend.

Enums in the protocol’s own serialized form use snake-case type tags with a data payload. Provider payloads use the mappings above. Serializing the protocol value directly is therefore not a substitute for a provider adapter.

Provider adapters

The System One implementation and OpenAI Decisions implementation are reference examples of request encoding and response conversion. Both supplied clients make one attempt per call, with a timeout covering the request and reading the body.

You can use either supplied client, or convert an existing client’s data yourself. RoutedDecisionClient is an optional shared client interface. The guide’s direct call handling shows the application boundary; Decision Answers covers the response contract.