Documentation
¶
Index ¶
- type DSLConfig
- type NormalizeOptions
- type OllamaModelTag
- type OllamaTagsResponse
- type PerformanceMetrics
- 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 StepDependency
- 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
ParallelSteps map[string][]Step // Steps that can be executed in parallel
}
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 OllamaModelTag ¶ added in v0.0.25
type OllamaModelTag struct {
Name string `json:"name"`
}
OllamaModelTag represents the details of a single model tag from /api/tags
type OllamaTagsResponse ¶ added in v0.0.25
type OllamaTagsResponse struct {
Models []OllamaModelTag `json:"models"`
}
OllamaTagsResponse represents the top-level structure of Ollama's /api/tags response
type PerformanceMetrics ¶ added in v0.0.20
type PerformanceMetrics struct {
InputProcessingTime int64 // Time in milliseconds to process inputs
ModelProcessingTime int64 // Time in milliseconds for model processing
ActionProcessingTime int64 // Time in milliseconds for action processing
OutputProcessingTime int64 // Time in milliseconds for output processing
TotalProcessingTime int64 // Total time in milliseconds for the step
}
PerformanceMetrics tracks timing information for processing steps
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, runtimeDir ...string) *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 ProgressParallelStep // New type for parallel step updates )
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
IsParallel bool // Whether this update is from a parallel step
ParallelID string // Identifier for the parallel step group
PerformanceMetrics *PerformanceMetrics // Performance metrics for the step
}
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 {
Type string `yaml:"type"` // Step type (default is standard LLM step)
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
BatchMode string `yaml:"batch_mode"` // How to process multiple files: "combined" (default) or "individual"
SkipErrors bool `yaml:"skip_errors"` // Whether to continue processing if some files fail
// OpenAI Responses API specific fields
Instructions string `yaml:"instructions"` // System message
Tools []map[string]interface{} `yaml:"tools"` // Tools configuration
PreviousResponseID string `yaml:"previous_response_id"` // For conversation state
MaxOutputTokens int `yaml:"max_output_tokens"` // Token limit
Temperature float64 `yaml:"temperature"` // Temperature setting
TopP float64 `yaml:"top_p"` // Top-p sampling
Stream bool `yaml:"stream"` // Whether to stream the response
ResponseFormat map[string]interface{} `yaml:"response_format"` // Format specification (e.g., JSON)
}
StepConfig represents the configuration for a single step
type StepDependency ¶ added in v0.0.20
StepDependency represents a dependency between steps