Class: DSPy::Teleprompt::Teleprompter::OptimizationResult
- Inherits:
-
Object
- Object
- DSPy::Teleprompt::Teleprompter::OptimizationResult
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/teleprompt/teleprompter.rb
Overview
Result of an optimization run
Instance Attribute Summary collapse
-
#best_score_name ⇒ Object
readonly
Returns the value of attribute best_score_name.
-
#best_score_value ⇒ Object
readonly
Returns the value of attribute best_score_value.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#optimized_program ⇒ Object
readonly
Returns the value of attribute optimized_program.
-
#scores ⇒ Object
readonly
Returns the value of attribute scores.
Instance Method Summary collapse
-
#initialize(optimized_program:, scores:, history:, best_score_name: nil, best_score_value: nil, metadata: {}) ⇒ OptimizationResult
constructor
A new instance of OptimizationResult.
- #to_h ⇒ Object
Constructor Details
#initialize(optimized_program:, scores:, history:, best_score_name: nil, best_score_value: nil, metadata: {}) ⇒ OptimizationResult
Returns a new instance of OptimizationResult.
102 103 104 105 106 107 108 109 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 102 def initialize(optimized_program:, scores:, history:, best_score_name: nil, best_score_value: nil, metadata: {}) @optimized_program = optimized_program @scores = scores.freeze @history = history.freeze @best_score_name = best_score_name @best_score_value = best_score_value @metadata = .freeze end |
Instance Attribute Details
#best_score_name ⇒ Object (readonly)
Returns the value of attribute best_score_name.
84 85 86 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 84 def best_score_name @best_score_name end |
#best_score_value ⇒ Object (readonly)
Returns the value of attribute best_score_value.
87 88 89 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 87 def best_score_value @best_score_value end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
81 82 83 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 81 def history @history end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
90 91 92 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 90 def @metadata end |
#optimized_program ⇒ Object (readonly)
Returns the value of attribute optimized_program.
75 76 77 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 75 def optimized_program @optimized_program end |
#scores ⇒ Object (readonly)
Returns the value of attribute scores.
78 79 80 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 78 def scores @scores end |
Instance Method Details
#to_h ⇒ Object
112 113 114 115 116 117 118 119 120 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 112 def to_h { scores: @scores, history: @history, best_score_name: @best_score_name, best_score_value: @best_score_value, metadata: @metadata } end |