Dsxir. Predictor behaviour
(dsxir v0.1.0)
Copy Markdown
Predictor behaviour. A predictor is a stateless module that turns inputs into
a %Dsxir.Prediction{} by routing through an adapter and the active LM.
Augmented outputs
Some predictors synthesize extra output fields at runtime that are not
declared on the underlying signature module (e.g. :reasoning from
Dsxir.Predictor.ChainOfThought, :trajectory from
Dsxir.Predictor.ReAct). Impls report these via the optional
augmented_outputs/1 callback so that Dsxir.Artifact allows them
through the demo field validation on save/load. The callback is
optional; impls that do not augment their signature can omit it.
Summary
Callbacks
Output field names synthesized by the predictor at runtime, in addition
to the declared outputs of signature. Optional. Defaults to [] for
impls that do not implement it.
Functions
Resolve the augmented output names for impl against signature, or
return [] when the impl does not implement augmented_outputs/1.
Types
@type signature() :: module() | Dsxir.Signature.Compiled.t()
Callbacks
Output field names synthesized by the predictor at runtime, in addition
to the declared outputs of signature. Optional. Defaults to [] for
impls that do not implement it.
@callback forward( state :: Dsxir.Program.State.t(), signature :: signature(), inputs :: map(), opts :: keyword() ) :: {Dsxir.Program.State.t(), Dsxir.Prediction.t()}
Functions
Resolve the augmented output names for impl against signature, or
return [] when the impl does not implement augmented_outputs/1.