Class: DSPy::Teleprompt::Teleprompter::Config

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

Overview

Configuration for optimization runs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



43
44
45
46
47
48
49
50
51
52
# File 'lib/dspy/teleprompt/teleprompter.rb', line 43

def initialize
  @max_bootstrapped_examples = 4
  @max_labeled_examples = 16
  @num_candidate_examples = 50
  @num_threads = 1
  @max_errors = 5
  @require_validation_examples = true
  @save_intermediate_results = false
  @save_path = nil
end

Instance Attribute Details

#max_bootstrapped_examplesObject

Returns the value of attribute max_bootstrapped_examples.



19
20
21
# File 'lib/dspy/teleprompt/teleprompter.rb', line 19

def max_bootstrapped_examples
  @max_bootstrapped_examples
end

#max_errorsObject

Returns the value of attribute max_errors.



31
32
33
# File 'lib/dspy/teleprompt/teleprompter.rb', line 31

def max_errors
  @max_errors
end

#max_labeled_examplesObject

Returns the value of attribute max_labeled_examples.



22
23
24
# File 'lib/dspy/teleprompt/teleprompter.rb', line 22

def max_labeled_examples
  @max_labeled_examples
end

#num_candidate_examplesObject

Returns the value of attribute num_candidate_examples.



25
26
27
# File 'lib/dspy/teleprompt/teleprompter.rb', line 25

def num_candidate_examples
  @num_candidate_examples
end

#num_threadsObject

Returns the value of attribute num_threads.



28
29
30
# File 'lib/dspy/teleprompt/teleprompter.rb', line 28

def num_threads
  @num_threads
end

#require_validation_examplesObject

Returns the value of attribute require_validation_examples.



34
35
36
# File 'lib/dspy/teleprompt/teleprompter.rb', line 34

def require_validation_examples
  @require_validation_examples
end

#save_intermediate_resultsObject

Returns the value of attribute save_intermediate_results.



37
38
39
# File 'lib/dspy/teleprompt/teleprompter.rb', line 37

def save_intermediate_results
  @save_intermediate_results
end

#save_pathObject

Returns the value of attribute save_path.



40
41
42
# File 'lib/dspy/teleprompt/teleprompter.rb', line 40

def save_path
  @save_path
end

Instance Method Details

#to_hObject



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/dspy/teleprompt/teleprompter.rb', line 55

def to_h
  {
    max_bootstrapped_examples: @max_bootstrapped_examples,
    max_labeled_examples: @max_labeled_examples,
    num_candidate_examples: @num_candidate_examples,
    num_threads: @num_threads,
    max_errors: @max_errors,
    require_validation_examples: @require_validation_examples,
    save_intermediate_results: @save_intermediate_results,
    save_path: @save_path
  }
end