Expand description
Provider-agnostic judgment trait and wire types for polychrome.
A judgment is a typed decision over a state: a yes/no probability
(Question::Noul) or one option from a closed set
(Question::Choice). A judgment model returns probabilities, never
generated text, so code can threshold and combine the answers without
parsing prose.
JudgmentProvider is the seam between a decision site and any concrete
backend, the same way polyc_llm::LlmProvider is for completions: one
implementation crate per backend, dispatched behind DynJudgment. The
core never names a vendor.
Modules§
- fallback
FallbackJudgment: compose a primary judgment backend with a fallback one.
Structs§
- BoxError
- A backend error erased to one concrete type.
- Erased
Judgment - Wraps a concrete
JudgmentProviderand erases its error toBoxError, so the wrapped value coerces toDynJudgment. - Judgment
Request - One request: a state and the questions to answer over it.
- Judgment
Response - One response: an answer per question id, plus usage.
- Judgment
Usage - Token accounting for one request.
- Noul
Criteria - What a yes and a no mean for a
Question::Noul, when the boundary needs spelling out.
Enums§
- Answer
- One typed answer, matching its question’s variant.
- Judgment
Error - The failure classes a judgment backend reports.
- Judgment
Source - Which path answered a
JudgmentRequest. - Question
- One typed question over a state.
Traits§
- Judgment
Provider - The seam between a decision site and any concrete judgment backend.
Functions§
- into_
dyn - Erases a concrete backend and wraps it in an
Arcas aDynJudgment.
Type Aliases§
- DynJudgment
- The single trait-object type a decision site stores.