Documentation
¶
Overview ¶
Package llmstep implements the "llm" transform primitive: a user-authored LLM step that runs a caller-supplied instruction over the pipeline's data and writes the model's response into State.Rows. Unlike describe-work (which groups commits and always returns text), llm takes its input as-is — State.Rows when an earlier primitive already produced one, otherwise the raw timeline — and its instruction and (optional) output JSON schema come entirely from the step's params.
LLMClient (interfaces.go) is a small in-package interface the engine wires to elelem; llm never talks to a model provider directly.
Index ¶
Constants ¶
const Name = "llm"
Name is the primitive's registry key.
Variables ¶
var ErrMissingDependency = errors.New("llm missing required dependency")
ErrMissingDependency is returned by New when llm is nil — the llm primitive cannot run without a client.
var ErrMissingInstruction = errors.New("llm missing required instruction param")
ErrMissingInstruction is returned by New when the step params omit the required "instruction" field.
Functions ¶
func New ¶
New builds an llm primitive from llm — the engine's wired LLMClient — and its JSON params, shaped {"instruction": string, "schema": object, "name": string}. instruction is required; schema defaults to nil (plain text output); name defaults to "llm". Returns ErrMissingDependency when llm is nil, or ErrMissingInstruction when instruction is empty.
Types ¶
type LLMClient ¶
type LLMClient interface {
Complete(
ctx context.Context,
instruction, data string,
schema []byte,
) (string, error)
}
LLMClient runs one user-authored LLM step over serialized data. schema nil/empty selects a plain-text response; a non-empty schema selects JSON-schema-constrained structured output. The engine wires this to elelem; llm never talks to a model provider directly.