Package-level declarations
Types
A question that asks the model to pick one option from a closed set.
The answer to one question in a decision response. There is one implementation per question kind and no other implementation can exist, so a Kotlin when or a Java switch over an answer covers every case.
What a decision service can accept, as the service reports it: the question kinds it answers. Create one with of.
A caller-owned value read out of a decision response, kept together with the response it came from. Build one with one of the of overloads, which read the response's answered values and convert them to the target type with Jackson. The default mapper fails when a constructor parameter of the target has no answered value, so a record component with no matching question is an error. A mapper passed in keeps its own settings.
Thrown when a decision response's answers cannot be projected to a caller's target type: either one or more answers carry no representable value, or the values that were collected do not fit the target type.
One decision spec together with the input it should be evaluated against.
The answers a model gave to a decision spec, one per question, in spec order.
Classification plus proposition assessment. Applications own any routing or revision policy.
Pure metadata for the decision family, which also supports classification.
An immutable, ordered set of questions to put to a model in one decision. Question names are unique within a spec and name the answers in a response.
Marks the receiver types of the Kotlin decision spec DSL. Inside a block with a marked receiver, calls cannot reach an outer marked receiver without an explicit label, so a question block cannot add a question to the enclosing spec by accident.
The receiver passed to a decisionSpec block. Each method here adds one question to the spec being built, through the matching DecisionSpec.Builder method, so a spec built with this DSL validates exactly like one built with the builder or with Questions.named(...).
The probability a provider reported for one level of a rating scale. The id is nonblank and the probability is finite and between 0 and 1 inclusive.
A question that asks the model whether a proposition is true.
Text and a nonblank proposition to assess against it. Input may be empty. The default string representation omits both text fields.
A proposition assessment keeps false answers, insufficient evidence, and failures distinct.
An immutable question definition whose answers have type R. The three implementations are PropositionQuestionSpec, ChoiceQuestionSpec and RatingQuestionSpec, and no other implementation can exist.
The closed set of question kinds. Each kind fixes the result type of its questions.
One level on an ordinal rating scale, such as one point on a five-point mood scale. The id identifies the level on the wire and in provider responses. The description defaults to the id, so a caller can name a level once and use that name as both its identity and its label.
A question that asks the model to rate something on an ordered scale of levels. The first level has index 0 and the last has index levels.size - 1.
The evidence a provider returned for a rating question: a selected level, a per-level distribution, a score, or any combination of these. Each part comes from the provider's response as reported. A selected level is present only when the provider selected one, and a distribution only when the provider reported one. Validation against a RatingQuestionSpec checks that a selected level and a distribution belong to the question's scale.
A single numeric score reported for a rating, together with the statistic it represents. The value is finite and at least zero.
The statistic that a RatingScore reports.
Thrown when a decision service cannot answer a request because a question kind is missing from its capabilities.
Functions
Builds a decision spec with a Kotlin receiver DSL. The block declares questions on DecisionSpecScope and runs once. The spec is built once, after the block returns, so later calls on a leaked question builder cannot change it.