processor

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSLConfig

type DSLConfig struct {
	Steps []Step
}

DSLConfig represents the structure of the DSL configuration

type NormalizeOptions

type NormalizeOptions struct {
	AllowEmpty bool // Whether to allow empty strings in the result
}

NormalizeOptions represents options for string slice normalization

type Processor

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

Processor handles the DSL processing pipeline

func NewProcessor

func NewProcessor(config *DSLConfig, envConfig *config.EnvConfig, verbose bool) *Processor

NewProcessor creates a new DSL processor

func (*Processor) GetModelProvider

func (p *Processor) GetModelProvider(modelName string) models.Provider

GetModelProvider returns the provider for the specified model

func (*Processor) GetProcessedInputs

func (p *Processor) GetProcessedInputs() []*input.Input

GetProcessedInputs returns all processed input contents

func (*Processor) LastOutput

func (p *Processor) LastOutput() string

LastOutput returns the last output value

func (*Processor) NormalizeStringSlice

func (p *Processor) NormalizeStringSlice(val interface{}) []string

NormalizeStringSlice converts interface{} to []string

func (*Processor) Process

func (p *Processor) Process() error

Process executes the DSL processing pipeline

func (*Processor) SetLastOutput

func (p *Processor) SetLastOutput(output string)

SetLastOutput sets the last output value, useful for initializing with STDIN data

type Spinner

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

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Disable

func (s *Spinner) Disable()

Disable prevents the spinner from showing any output

func (*Spinner) Start

func (s *Spinner) Start(message string)

func (*Spinner) Stop

func (s *Spinner) Stop()

type Step

type Step struct {
	Name   string
	Config StepConfig
}

Step represents a named step in the DSL

type StepConfig

type StepConfig struct {
	Input      interface{} `yaml:"input"`       // Can be string or map[string]interface{}
	Model      interface{} `yaml:"model"`       // Can be string or []string
	Action     interface{} `yaml:"action"`      // Can be string or []string
	Output     interface{} `yaml:"output"`      // Can be string or []string
	NextAction interface{} `yaml:"next-action"` // Can be string or []string
}

StepConfig represents the configuration for a single step

Jump to

Keyboard shortcuts

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