Skip to main content

Crate polyc_judgment

Crate polyc_judgment 

Source
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.
ErasedJudgment
Wraps a concrete JudgmentProvider and erases its error to BoxError, so the wrapped value coerces to DynJudgment.
JudgmentRequest
One request: a state and the questions to answer over it.
JudgmentResponse
One response: an answer per question id, plus usage.
JudgmentUsage
Token accounting for one request.
NoulCriteria
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.
JudgmentError
The failure classes a judgment backend reports.
JudgmentSource
Which path answered a JudgmentRequest.
Question
One typed question over a state.

Traits§

JudgmentProvider
The seam between a decision site and any concrete judgment backend.

Functions§

into_dyn
Erases a concrete backend and wraps it in an Arc as a DynJudgment.

Type Aliases§

DynJudgment
The single trait-object type a decision site stores.