Class: DSPy::Teleprompt::SimpleOptimizer::OptimizerConfig

Inherits:
Config
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/teleprompt/simple_optimizer.rb

Overview

Configuration specific to simple optimization

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptimizerConfig

Returns a new instance of OptimizerConfig.



35
36
37
38
39
40
41
42
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 35

def initialize
  super
  @num_trials = 10
  @search_strategy = "random" # or "grid"
  @use_instruction_optimization = true
  @use_few_shot_optimization = true
  @proposer_config = DSPy::Propose::GroundedProposer::Config.new
end

Instance Attribute Details

#num_trialsObject

Returns the value of attribute num_trials.



20
21
22
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 20

def num_trials
  @num_trials
end

#proposer_configObject

Returns the value of attribute proposer_config.



32
33
34
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 32

def proposer_config
  @proposer_config
end

#search_strategyObject

Returns the value of attribute search_strategy.



23
24
25
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 23

def search_strategy
  @search_strategy
end

#use_few_shot_optimizationObject

Returns the value of attribute use_few_shot_optimization.



29
30
31
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 29

def use_few_shot_optimization
  @use_few_shot_optimization
end

#use_instruction_optimizationObject

Returns the value of attribute use_instruction_optimization.



26
27
28
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 26

def use_instruction_optimization
  @use_instruction_optimization
end