Skip to main content

Module wire

Module wire 

Source
Expand description

The System One wire shapes: one typed question out, one typed answer back, and the check an answer must survive before it is trusted.

Re-exports§

use std::collections::BTreeMap; 🔒
use std::collections::BTreeSet; 🔒

Structs§

AskOutcome
A resolved decision: what answered, the answer, and what it cost, if the provider reported a usage block.
NoulCriteria
What yes and no mean for a noul question, when the boundary matters; the keys are fixed, the values are any JSON.
Usage
Token usage as the provider reports it; cost only on OpenRouter.

Enums§

Answer
One typed answer, deserialized from the response.
Question
One typed question; serialized as the request’s questions value. instructions and the criteria values the API types as any JSON (string, object, array or null; a score level no null) cross verbatim.

Functions§

check_confidence 🔒
check_probability_map 🔒
Keys, values, and the sum tolerance pydantic-ai applies for the provider’s two-decimal display: 1e-6 + n * 0.005.
check_unit 🔒
A 0..=1 field: noul, a probability, a confidence.
validate_answer
The answer must be internally consistent with the question it answers: keys cover the criteria, probabilities are probabilities, the score is inside its levels. Anything else is a provider bug, not a decision.