Dsxir. Optimizer. COPRO. Proposer
(dsxir v0.3.0)
Copy Markdown
Instruction proposer for Dsxir.Optimizer.COPRO. Dispatches to Basic
(round 0, from the current instruction) or GivenAttempts (later rounds,
from the sorted attempt history). Both return exactly n instructions.
Summary
Functions
Truncate list to n items, or repeat fallback until the result has
exactly n items.
Parse an LM completion into a list of instruction strings.
Render a signature's field list as a name (type) block, one field per line.
Used by both proposers to ground the prompt in the predictor's shape.
Types
@type ctx() :: map()
Functions
@spec pad([String.t()], pos_integer(), String.t()) :: [String.t()]
Truncate list to n items, or repeat fallback until the result has
exactly n items.
Parse an LM completion into a list of instruction strings.
@spec propose(ctx()) :: {:ok, [String.t()]} | {:error, Exception.t()}
@spec render_fields([Dsxir.Signature.Field.t()]) :: String.t()
Render a signature's field list as a name (type) block, one field per line.
Used by both proposers to ground the prompt in the predictor's shape.