Documentation
¶
Index ¶
- type DSLConfig
- type NormalizeOptions
- type Processor
- func (p *Processor) GetModelProvider(modelName string) models.Provider
- func (p *Processor) GetProcessedInputs() []*input.Input
- func (p *Processor) LastOutput() string
- func (p *Processor) NormalizeStringSlice(val interface{}) []string
- func (p *Processor) Process() error
- func (p *Processor) SetLastOutput(output string)
- func (p *Processor) SetProgressWriter(w ProgressWriter)
- type ProgressType
- type ProgressUpdate
- type ProgressWriter
- type Spinner
- type Step
- type StepConfig
- type StepInfo
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, serverConfig *config.ServerConfig, verbose bool) *Processor
NewProcessor creates a new DSL processor
func (*Processor) GetModelProvider ¶
GetModelProvider returns the provider for the specified model
func (*Processor) GetProcessedInputs ¶
GetProcessedInputs returns all processed input contents
func (*Processor) LastOutput ¶
LastOutput returns the last output value
func (*Processor) NormalizeStringSlice ¶
NormalizeStringSlice converts interface{} to []string
func (*Processor) SetLastOutput ¶
SetLastOutput sets the last output value, useful for initializing with STDIN data
func (*Processor) SetProgressWriter ¶ added in v0.0.14
func (p *Processor) SetProgressWriter(w ProgressWriter)
SetProgressWriter sets the progress writer for streaming updates
type ProgressType ¶ added in v0.0.14
type ProgressType int
ProgressType represents different types of progress updates
const ( ProgressSpinner ProgressType = iota ProgressStep ProgressComplete ProgressError ProgressOutput // New type for output events )
type ProgressUpdate ¶ added in v0.0.14
type ProgressUpdate struct {
Type ProgressType
Message string
Error error
Step *StepInfo // Optional step information
Stdout string // Content from STDOUT when Type is ProgressOutput
}
ProgressUpdate represents a progress update from the processor
type ProgressWriter ¶ added in v0.0.14
type ProgressWriter interface {
WriteProgress(update ProgressUpdate) error
}
ProgressWriter is an interface for handling progress updates
func NewChannelProgressWriter ¶ added in v0.0.14
func NewChannelProgressWriter(ch chan<- ProgressUpdate) ProgressWriter
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) SetProgressWriter ¶ added in v0.0.14
func (s *Spinner) SetProgressWriter(w ProgressWriter)
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