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.
101 102 103 104 105 106 107 108 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 101 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.
83 84 85 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 83 def best_score_name @best_score_name end |
#best_score_value ⇒ Object (readonly)
Returns the value of attribute best_score_value.
86 87 88 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 86 def best_score_value @best_score_value end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
80 81 82 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 80 def history @history end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
89 90 91 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 89 def @metadata end |
#optimized_program ⇒ Object (readonly)
Returns the value of attribute optimized_program.
74 75 76 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 74 def optimized_program @optimized_program end |
#scores ⇒ Object (readonly)
Returns the value of attribute scores.
77 78 79 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 77 def scores @scores end |
Instance Method Details
#to_h ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/dspy/teleprompt/teleprompter.rb', line 111 def to_h { scores: @scores, history: @history, best_score_name: @best_score_name, best_score_value: @best_score_value, metadata: @metadata } end |