steps

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateCompletionStep

type GenerateCompletionStep struct {
	// contains filtered or unexported fields
}

GenerateCompletionStep is a pipeline step that calls an LLM client to generate a completion.

func NewGenerateCompletionStep

func NewGenerateCompletionStep(client core.Client, inputKey, outputKey, model string) *GenerateCompletionStep

NewGenerateCompletionStep creates a new step to invoke an LLM. - client: The core.Client to use (e.g., openai.Client). - inputKey: The state key to read the user prompt from (expects string). - outputKey: The state key to write the string response to. - model: The model name to use.

func (*GenerateCompletionStep) Execute

func (s *GenerateCompletionStep) Execute(ctx context.Context, state *pipeline.State) error

Execute performs the LLM call.

func (*GenerateCompletionStep) Name

func (s *GenerateCompletionStep) Name() string

Name returns the step's name.

func (*GenerateCompletionStep) WithSystemPrompt

func (s *GenerateCompletionStep) WithSystemPrompt(sysPrompt string) *GenerateCompletionStep

WithSystemPrompt sets an optional system prompt for this step.

type TemplateStep

type TemplateStep struct {
	// contains filtered or unexported fields
}

TemplateStep is a pipeline step that renders a text template using data from the state.

func NewTemplateStep

func NewTemplateStep(templateStr, outputKey string, inputKeys ...string) *TemplateStep

NewTemplateStep creates a step that renders a template. - templateStr: The Go text/template string. - outputKey: The state key to write the rendered string to. - inputKeys: Keys from the state to pass into the template as variables.

func (*TemplateStep) Execute

func (s *TemplateStep) Execute(ctx context.Context, state *pipeline.State) error

Execute renders the template.

func (*TemplateStep) Name

func (s *TemplateStep) Name() string

Name returns the step's name.

Jump to

Keyboard shortcuts

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