Versions in this module Expand all Collapse all v0 v0.3.0 May 26, 2026 v0.2.1 May 26, 2026 Changes in this version + func ComputeGradientPrompt(paramName, currentValue, feedback string, examples []string) string + func FormatPromptExamples(examples []PromptExample) string + func OptimizePrompt(ctx context.Context, llm LLMClient, model string, po *PromptOptimizer, ...) (string, error) + type ABTest struct + A DSPyVariant + B DSPyVariant + func NewABTest(a, b DSPyVariant) *ABTest + type DSPyExample = PromptExample + type DSPyVariant = PromptVariant + type LLMClient interface + Chat func(ctx context.Context, msgs []types.EyrieMessage, opts types.ChatOptions) (*types.EyrieResponse, error) + type OptimizationStep struct + Gradient PromptGradient + NewScore float64 + NewValue string + OldScore float64 + OldValue string + Parameter string + Timestamp time.Time + type Optimizer = PromptOptimizer + func NewOptimizer() *Optimizer + type PromptExample struct + Category string + Input string + Output string + Score float64 + type PromptFewShotSelector struct + Examples []PromptExample + func (fs *PromptFewShotSelector) Select(query string, k int) []PromptExample + type PromptGradient struct + Direction string + Feedback string + Magnitude float64 + Parameter string + type PromptOptimizer struct + History []OptimizationStep + Parameters map[string]*PromptParameter + Path string + func NewPromptOptimizer() *PromptOptimizer + func (po *PromptOptimizer) ApplyGradient(paramName, newValue string, gradient PromptGradient) + func (po *PromptOptimizer) Get(name string) string + func (po *PromptOptimizer) NeedsOptimization(threshold float64) []*PromptParameter + func (po *PromptOptimizer) RecordFailure(paramName, feedback string) + func (po *PromptOptimizer) RecordSuccess(paramName string) + func (po *PromptOptimizer) Register(name, initialValue string) + type PromptParameter struct + Name string + Score float64 + Value string + Version int + type PromptTuner struct + func NewPromptTuner() *PromptTuner + func (pt *PromptTuner) BestVariant(section string) (string, float64) + func (pt *PromptTuner) RecordOutcome(section, content string, success bool) + func (pt *PromptTuner) Report() string + type PromptVariant struct + Content string + LastUsed time.Time + Score float64 + Section string + Successes int + Uses int + type Tuner = PromptTuner + func NewTuner() *Tuner + type Variant = PromptVariant