Documentation
¶
Index ¶
- Constants
- func ExtractScriptContent(response string) string
- func GetPlatformInfo() string
- type BaseProvider
- func (p *BaseProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
- func (p *BaseProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
- func (p *BaseProvider) GenerateScript(ctx context.Context, description string) (string, error)
- func (p *BaseProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
- func (p *BaseProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
- func (p *BaseProvider) Name() string
- func (p *BaseProvider) ValidateConfig() error
- type ClaudeConfig
- type ClaudeProvider
- func (p *ClaudeProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
- func (p *ClaudeProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
- func (p *ClaudeProvider) GenerateScript(ctx context.Context, description string) (string, error)
- func (p *ClaudeProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
- func (p *ClaudeProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
- func (p *ClaudeProvider) Name() string
- type OllamaConfig
- type OllamaProvider
- type OpenAIConfig
- type OpenAIProvider
- func (p *OpenAIProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
- func (p *OpenAIProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
- func (p *OpenAIProvider) GenerateScript(ctx context.Context, description string) (string, error)
- func (p *OpenAIProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
- func (p *OpenAIProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
- func (p *OpenAIProvider) Name() string
- type Provider
- type ProviderConfig
- type ScriptPair
- type Test
- type TestFailure
Constants ¶
const ( // FeatureScriptPrompt is used to generate the main feature script FeatureScriptPrompt = `` /* 1032-byte string literal not displayed */ // TestScriptPrompt is used to generate the test script TestScriptPrompt = `` /* 1538-byte string literal not displayed */ // FixScriptPrompt is used to fix a script based on test failures FixScriptPrompt = `` /* 915-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func ExtractScriptContent ¶ added in v0.0.3
ExtractScriptContent extracts the content between <script> tags from an LLM response. If no <script> tags are found, returns the entire response.
func GetPlatformInfo ¶
func GetPlatformInfo() string
GetPlatformInfo returns information about the current platform
Types ¶
type BaseProvider ¶
type BaseProvider struct {
Config interface{}
}
BaseProvider provides common functionality for LLM providers
func (*BaseProvider) FixScript ¶
func (p *BaseProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
FixScript is a default implementation that returns an error
func (*BaseProvider) FixScripts ¶
func (p *BaseProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
FixScripts attempts to fix a script pair based on test failures
func (*BaseProvider) GenerateScript ¶
GenerateScript is a default implementation that returns an error
func (*BaseProvider) GenerateScripts ¶
func (p *BaseProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
GenerateScripts generates a main script and test script pair
func (*BaseProvider) GenerateTests ¶
func (p *BaseProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
GenerateTests is a default implementation that returns an error
func (*BaseProvider) Name ¶ added in v0.0.3
func (p *BaseProvider) Name() string
Name returns a human-readable name for the provider
func (*BaseProvider) ValidateConfig ¶
func (p *BaseProvider) ValidateConfig() error
ValidateConfig validates the provider configuration
type ClaudeConfig ¶
ClaudeConfig represents configuration for the Claude provider
type ClaudeProvider ¶
type ClaudeProvider struct { BaseProvider // contains filtered or unexported fields }
ClaudeProvider implements the Provider interface using Anthropic's Claude
func NewClaudeProvider ¶
func NewClaudeProvider(config ClaudeConfig) (*ClaudeProvider, error)
NewClaudeProvider creates a new Claude provider
func (*ClaudeProvider) FixScript ¶
func (p *ClaudeProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
FixScript attempts to fix a script based on test failures
func (*ClaudeProvider) FixScripts ¶
func (p *ClaudeProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
FixScripts attempts to fix both scripts based on test failures
func (*ClaudeProvider) GenerateScript ¶
GenerateScript creates a shell script from a natural language description
func (*ClaudeProvider) GenerateScripts ¶
func (p *ClaudeProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
GenerateScripts creates a main script and test script from a natural language description
func (*ClaudeProvider) GenerateTests ¶
func (p *ClaudeProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
GenerateTests creates test cases for a script based on its description
func (*ClaudeProvider) Name ¶ added in v0.0.3
func (p *ClaudeProvider) Name() string
Name returns a human-readable name for the provider
type OllamaConfig ¶
OllamaConfig represents configuration for the Ollama provider
type OllamaProvider ¶
type OllamaProvider struct { BaseProvider // contains filtered or unexported fields }
OllamaProvider implements the Provider interface using Ollama
func NewOllamaProvider ¶
func NewOllamaProvider(config OllamaConfig) (*OllamaProvider, error)
NewOllamaProvider creates a new Ollama provider
func (*OllamaProvider) FixScripts ¶
func (p *OllamaProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
FixScripts attempts to fix both scripts based on test failures
func (*OllamaProvider) GenerateScripts ¶
func (p *OllamaProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
GenerateScripts creates a main script and test script from a natural language description
func (*OllamaProvider) Name ¶ added in v0.0.3
func (p *OllamaProvider) Name() string
Name returns a human-readable name for the provider
type OpenAIConfig ¶
OpenAIConfig represents configuration for the OpenAI provider
type OpenAIProvider ¶
type OpenAIProvider struct { BaseProvider // contains filtered or unexported fields }
OpenAIProvider implements the Provider interface using OpenAI's API
func NewOpenAIProvider ¶
func NewOpenAIProvider(config OpenAIConfig) (*OpenAIProvider, error)
NewOpenAIProvider creates a new OpenAI provider
func (*OpenAIProvider) FixScript ¶
func (p *OpenAIProvider) FixScript(ctx context.Context, script string, failures []TestFailure) (string, error)
FixScript attempts to fix a script based on test failures
func (*OpenAIProvider) FixScripts ¶
func (p *OpenAIProvider) FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error)
FixScripts attempts to fix both scripts based on test failures
func (*OpenAIProvider) GenerateScript ¶
GenerateScript creates a shell script from a natural language description
func (*OpenAIProvider) GenerateScripts ¶
func (p *OpenAIProvider) GenerateScripts(ctx context.Context, description string) (ScriptPair, error)
GenerateScripts creates a main script and test script from a natural language description
func (*OpenAIProvider) GenerateTests ¶
func (p *OpenAIProvider) GenerateTests(ctx context.Context, script string, description string) ([]Test, error)
GenerateTests creates test cases for a script based on its description
func (*OpenAIProvider) Name ¶ added in v0.0.3
func (p *OpenAIProvider) Name() string
Name returns a human-readable name for the provider
type Provider ¶
type Provider interface { // GenerateScripts creates a main script and test script from a natural language description GenerateScripts(ctx context.Context, description string) (ScriptPair, error) // FixScripts attempts to fix both scripts based on test failures FixScripts(ctx context.Context, scripts ScriptPair, error string) (ScriptPair, error) // Name returns a human-readable name for the provider Name() string }
Provider defines the interface for LLM providers
func NewProvider ¶
NewProvider creates a new LLM provider based on the provider name
type ProviderConfig ¶
type ProviderConfig struct { Provider string `yaml:"provider"` Ollama OllamaConfig `yaml:"ollama,omitempty"` Claude ClaudeConfig `yaml:"claude,omitempty"` OpenAI OpenAIConfig `yaml:"openai,omitempty"` }
ProviderConfig represents the configuration for any LLM provider
type ScriptPair ¶
type ScriptPair struct { MainScript string // The feature script that implements the functionality TestScript string // The test script that verifies the feature script }
ScriptPair represents a feature script and its test script