Documentation
¶
Overview ¶
Package modelread is the model stage that reads an item whole under its read decision's lens, and answers the item's note with a summary, a suggestion sentence, or both. Its prompt and answer schema are prompts.ModelRead, one prompt for each lens.
The read gate queues an item's model read in the write that appends a read decision whose verdict is model, unless the item holds a read that answers the decision's note. It withdraws a queued one where a later decision reads the item otherwise. The task carries that decision's lens and note. A worker holding a model port and the scanner runs it through modelstage's dispatch-once protocol. Before the answer is kept, the scanner reads its suggestion sentence. The output holds the findings and their spans beside the answer, so the sentence never travels without them. The summary is kept on the output alone and delivered nowhere.
Index ¶
Constants ¶
const ( // Capability is the capability of every model read's task. Capability = store.StageModelRead // Producer names the model read's outputs, whose version is the prompt's // under the output's lens. Producer = "model-read" // DefaultModel and DefaultEffort are what the read's run is asked for // where config names neither. DefaultModel = "haiku" DefaultEffort = "medium" )
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(port modelport.Port, client *worker.Client, scanner Scanner, settings modelstage.Settings, log *slog.Logger) worker.Handler
NewHandler is the worker handler that runs the model read through port under modelstage's dispatch-once protocol. It reads each task's parse through client, and scans each suggestion with scanner.
func Replayable ¶
func Replayable(st *store.Store) server.Replayable
Replayable is the read as a replay runs it again, such as with a new prompt or lens, over each item that route.ModelReadDue names. The replay first answers how many items it would run on and the median tokens by kind of the stage's newest stored runs, times that count, and queues only once a person confirms.
Types ¶
type Answer ¶
Answer is the model's answer, as prompts/model-read/answer.schema.json holds it. Either may be nil, and never both.
func ReadAnswer ¶
ReadAnswer checks raw against the schema of p, the prompt it answered, and decodes it. An answer holding neither a summary nor a suggestion fails as one that breaks the schema does.