llmstep

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 5 Imported by: 0

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

View Source
const Name = "llm"

Name is the primitive's registry key.

Variables

View Source
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.

View Source
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

func New(llm LLMClient, rawParams []byte) (transform.Primitive, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL