Dsxir. Optimizer. SIMBA. Proposer. OfferFeedback
(dsxir v0.5.0)
Copy Markdown
Internal signature and trace helpers for the SIMBA AppendRule strategy.
Given a better-vs-worse trajectory pair for the same input, the reflective LM
produces per-module advice that gets appended to each predictor's instruction.
Not a user-facing signature.
Summary
Functions
Unique predictor names from the trace, in first-seen order, as strings.
Turn the LM's advice output (a list of %{module, advice} maps) into a
%{module_name => advice} map. Tolerates string or atom keys. Malformed or
empty input yields %{} and never raises.
Recursively replace non-JSON-serializable terms with a placeholder string,
leaving maps, lists, tuples, and serializable scalars intact. Mirrors DSPy's
recursive_mask, used to safely render arbitrary input/metadata values.
Render a captured trace into a per-module trajectory string.
The internal OfferFeedback signature run by the AppendRule strategy.
Functions
@spec module_names([Dsxir.Trace.Entry.t()]) :: [String.t()]
Unique predictor names from the trace, in first-seen order, as strings.
Turn the LM's advice output (a list of %{module, advice} maps) into a
%{module_name => advice} map. Tolerates string or atom keys. Malformed or
empty input yields %{} and never raises.
Recursively replace non-JSON-serializable terms with a placeholder string,
leaving maps, lists, tuples, and serializable scalars intact. Mirrors DSPy's
recursive_mask, used to safely render arbitrary input/metadata values.
@spec render_trajectory([Dsxir.Trace.Entry.t()]) :: String.t()
Render a captured trace into a per-module trajectory string.
@spec signature() :: Dsxir.Signature.Compiled.t()
The internal OfferFeedback signature run by the AppendRule strategy.