Class: DSPy::Propose::GroundedProposer::ProposalResult
- Inherits:
-
Object
- Object
- DSPy::Propose::GroundedProposer::ProposalResult
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/propose/grounded_proposer.rb
Overview
Result of instruction proposal
Instance Attribute Summary collapse
-
#analysis ⇒ Object
readonly
Returns the value of attribute analysis.
-
#candidate_instructions ⇒ Object
readonly
Returns the value of attribute candidate_instructions.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #best_instruction ⇒ Object
-
#initialize(candidate_instructions:, analysis:, metadata:) ⇒ ProposalResult
constructor
A new instance of ProposalResult.
- #num_candidates ⇒ Object
Constructor Details
#initialize(candidate_instructions:, analysis:, metadata:) ⇒ ProposalResult
Returns a new instance of ProposalResult.
71 72 73 74 75 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 71 def initialize(candidate_instructions:, analysis:, metadata:) @candidate_instructions = candidate_instructions.freeze @analysis = analysis.freeze @metadata = .freeze end |
Instance Attribute Details
#analysis ⇒ Object (readonly)
Returns the value of attribute analysis.
59 60 61 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 59 def analysis @analysis end |
#candidate_instructions ⇒ Object (readonly)
Returns the value of attribute candidate_instructions.
56 57 58 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 56 def candidate_instructions @candidate_instructions end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
62 63 64 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 62 def @metadata end |
Instance Method Details
#best_instruction ⇒ Object
78 79 80 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 78 def best_instruction @candidate_instructions.first || "" end |
#num_candidates ⇒ Object
83 84 85 |
# File 'lib/dspy/propose/grounded_proposer.rb', line 83 def num_candidates @candidate_instructions.size end |