Schemas
Questions
Noul
NoulCriteria
Bases: BaseSchema
Optional descriptions of the two noul outcomes.
Source code in system_one/schemas.py
Choice
Bases: BaseSchema
A pick-one question over labelled options.
Source code in system_one/schemas.py
Score
Bases: BaseSchema
An ordinal question whose criteria index is the score.
Source code in system_one/schemas.py
Answers
NoulAnswer
Bases: ConfidentAnswer
A yes/no answer, where noul is the probability the statement holds.
Source code in system_one/schemas.py
ChoiceAnswer
Bases: ConfidentAnswer
The selected label and, when reported, the distribution it came from.
Source code in system_one/schemas.py
ScoreAnswer
Bases: ConfidentAnswer
A probability-weighted expected score, not an argmax.
Source code in system_one/schemas.py
ConfidentAnswer
Bases: BaseOutput
An answer that reports how much to trust itself on one scale for every type.
The hosted API always sends confidence; _derive fills it in for providers that
do not. A payload it cannot trust leaves confidence unset, because an absent
confidence is honest while a fabricated 1.0 is not.
Source code in system_one/schemas.py
Request and response
SystemOneInput
Bases: BaseSchema
The single normalized input shared by every backend.
Source code in system_one/schemas.py
SystemOneOutput
Bases: BaseOutput
Answers keyed by question name, with model and usage metadata.
Source code in system_one/schemas.py
Usage
Bases: BaseOutput
Token counts, and cost where the provider reports one.
Source code in system_one/schemas.py
Helpers
distribution
Read a probability vector, rejecting anything that is not one.
Confidence derived from logits, top-k remnants or any other unnormalized vector
is meaningless, so callers get a ValueError instead of a plausible number.
Source code in system_one/schemas.py
choice_confidence
Confidence in the selected choice: the probability of the reported label.
score_confidence
Confidence in the expected score: 1 - 2 * sd / (k - 1).
The score is an expectation over ordered levels, so its reliability is how tightly the mass sits around it. Entropy cannot see order and would rate a distribution split between the end levels — whose expectation lands in a valley no level claims — the same as one split between neighbours.
Source code in system_one/schemas.py
BaseSchema
Bases: BaseModel
Frozen, strict-input model whose unset optional fields stay off the wire.
The wrap serializer drops only top-level None field values, so a user-supplied
criteria={"calm": None} survives while an unset instructions does not;
exclude_none would drop both and exclude_unset would drop the type
discriminator.