Class: DSPy::Teleprompt::SimpleOptimizer::TrialResult
- Inherits:
-
Object
- Object
- DSPy::Teleprompt::SimpleOptimizer::TrialResult
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/teleprompt/simple_optimizer.rb
Overview
Result of a single optimization trial
Instance Attribute Summary collapse
-
#evaluation_result ⇒ Object
readonly
Returns the value of attribute evaluation_result.
-
#few_shot_examples ⇒ Object
readonly
Returns the value of attribute few_shot_examples.
-
#instruction ⇒ Object
readonly
Returns the value of attribute instruction.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#program ⇒ Object
readonly
Returns the value of attribute program.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#trial_number ⇒ Object
readonly
Returns the value of attribute trial_number.
Instance Method Summary collapse
-
#initialize(trial_number:, program:, instruction:, few_shot_examples:, evaluation_result:, score:, metadata:) ⇒ TrialResult
constructor
A new instance of TrialResult.
- #successful? ⇒ Boolean
Constructor Details
#initialize(trial_number:, program:, instruction:, few_shot_examples:, evaluation_result:, score:, metadata:) ⇒ TrialResult
Returns a new instance of TrialResult.
81 82 83 84 85 86 87 88 89 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 81 def initialize(trial_number:, program:, instruction:, few_shot_examples:, evaluation_result:, score:, metadata:) @trial_number = trial_number @program = program @instruction = instruction @few_shot_examples = few_shot_examples @evaluation_result = evaluation_result @score = score = .freeze end |
Instance Attribute Details
#evaluation_result ⇒ Object (readonly)
Returns the value of attribute evaluation_result.
62 63 64 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 62 def evaluation_result @evaluation_result end |
#few_shot_examples ⇒ Object (readonly)
Returns the value of attribute few_shot_examples.
59 60 61 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 59 def few_shot_examples @few_shot_examples end |
#instruction ⇒ Object (readonly)
Returns the value of attribute instruction.
56 57 58 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 56 def instruction @instruction end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
68 69 70 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 68 def end |
#program ⇒ Object (readonly)
Returns the value of attribute program.
53 54 55 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 53 def program @program end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
65 66 67 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 65 def score @score end |
#trial_number ⇒ Object (readonly)
Returns the value of attribute trial_number.
50 51 52 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 50 def trial_number @trial_number end |
Instance Method Details
#successful? ⇒ Boolean
92 93 94 |
# File 'lib/dspy/teleprompt/simple_optimizer.rb', line 92 def successful? @score > 0.0 end |