Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEnhancePrompt ¶
BuildEnhancePrompt constructs the prompt for Claude. Claude will directly edit the file using its native tools. If tableSummaryJSON is provided, it will be included in the prompt.
func GetSystemPrompt ¶
GetSystemPrompt returns the system prompt for Claude. If hasPreFetchedStats is true, uses the prompt that references pre-fetched statistics.
Types ¶
type CLIProvider ¶
type CLIProvider struct {
// contains filtered or unexported fields
}
CLIProvider implements the Provider interface for any CLI-based AI tool.
func NewCLIProvider ¶
func NewCLIProvider(config CLIProviderConfig, model string, fs afero.Fs) *CLIProvider
NewCLIProvider creates a new generic CLI provider.
func (*CLIProvider) Enhance ¶
func (p *CLIProvider) Enhance(ctx context.Context, prompt, systemPrompt string) error
Enhance executes the CLI with the given prompt.
func (*CLIProvider) EnsureCLI ¶
func (p *CLIProvider) EnsureCLI() error
EnsureCLI checks if the CLI is available.
func (*CLIProvider) SetAPIKey ¶
func (p *CLIProvider) SetAPIKey(apiKey string)
SetAPIKey sets the API key for the provider.
func (*CLIProvider) SetDebug ¶
func (p *CLIProvider) SetDebug(debug bool)
SetDebug enables or disables debug output.
type CLIProviderConfig ¶
type CLIProviderConfig struct {
Name string
BinaryName string
DefaultModel string
UseAPIKeyEnv bool // Whether to inject API key via environment variable.
APIKeyEnvVar string // Environment variable name for API key (e.g., "ANTHROPIC_API_KEY").
BuildArgs func(model, prompt, systemPrompt string) []string
CommonSearchPaths []string // Additional search paths beyond standard ones.
}
CLIProviderConfig holds configuration for a generic CLI provider.
type Enhancer ¶
type Enhancer struct {
// contains filtered or unexported fields
}
Enhancer coordinates the AI enhancement process for assets.
func NewEnhancer ¶
func NewEnhancer(providerType ProviderType, model string) *Enhancer
NewEnhancer creates a new Enhancer instance.
func (*Enhancer) EnhanceAsset ¶
func (e *Enhancer) EnhanceAsset(ctx context.Context, asset *pipeline.Asset, pipelineName, tableSummaryJSON string) error
EnhanceAsset runs AI enhancement on a single asset.
type EnhancerInterface ¶
type EnhancerInterface interface {
SetAPIKey(apiKey string)
SetDebug(debug bool)
EnsureCLI() error
EnhanceAsset(ctx context.Context, asset *pipeline.Asset, pipelineName, tableSummaryJSON string) error
}
EnhancerInterface defines the interface for asset enhancement.
type Provider ¶
type Provider interface {
Name() string
EnsureCLI() error
Enhance(ctx context.Context, prompt, systemPrompt string) error
SetDebug(debug bool)
SetAPIKey(apiKey string) // May be no-op for some providers
}
Provider defines the interface for AI CLI providers.
func NewClaudeProvider ¶
NewClaudeProvider creates a new Claude CLI provider.
func NewCodexProvider ¶
NewCodexProvider creates a new Codex CLI provider.
type ProviderType ¶
type ProviderType string
ProviderType represents the AI provider type.
const ( ProviderClaude ProviderType = "claude" ProviderOpenCode ProviderType = "opencode" ProviderCodex ProviderType = "codex" )