Skip to main content

Crate rig_typesafeai

Crate rig_typesafeai 

Source
Expand description

Experimental typed Jev evaluations alongside Rig agents.

Build a Jev client, take its evaluation model, then use Evaluate::evaluate with serializable state and a named Query. Its associated output type fixes the answer structure at compile time. Decisions retain distributions; routing and threshold policy remain in application code. Reported probabilities are preserved, including bounded hundredth-rounding error observed in live responses; they are not silently normalized.

Modules§

types
TypeSafe’s JSON protocol. Prefer the typed question constructors for application code.

Structs§

Choice
A choice question whose successful answer contains T.
ChoiceAnswer
A selected application value and the full distribution over alternatives.
DynamicQuery
Runtime-defined questions with runtime-keyed answers. Choose this explicitly when the application cannot know the question set at compile time.
DynamicScore
A score question whose rubric is supplied at runtime.
DynamicScoreAnswer
Expected zero-based rubric position and the distribution that produced it.
Evaluation
A batch of independent questions about one state.
EvaluationResult
Typed answers together with provider metadata.
Jev
Jev: its JevConfig on a transport. The model it builds sends through that transport.
JevConfig
The settings of Jev’s POST /v1/systemone endpoint, which are also its wire. connect puts them on a transport as a Jev client.
JoinedQuery
Two object-shaped queries serialized into a single flat request.
MappedQuery
A serializable query with a typed projection of its validated answers.
NamedQuery
A standalone question serialized under a runtime ID.
Noul
A yes/no question whose successful answer is NoulAnswer.
NoulAnswer
Probability of yes. Thresholds belong to the application’s policy.
Score
A score question with a statically known ordered rubric.
ScoreAnswer
Expected zero-based position and a distribution keyed by rubric variants.

Traits§

Evaluate
Typed evaluation on Jev over a Rig transport.
Query
A serializable query with a statically determined response and output. Struct field names (including Serde renames) supply the wire question IDs. Serde handles encoding and response structure; decode validates each field against its original question and converts it to its application answer.