Class: DSPy::Evaluate::EvaluationResult

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

Overview

Result of evaluating a single example

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example:, prediction:, trace:, metrics:, passed:) ⇒ EvaluationResult

Returns a new instance of EvaluationResult.



41
42
43
44
45
46
47
# File 'lib/dspy/evaluate.rb', line 41

def initialize(example:, prediction:, trace:, metrics:, passed:)
  @example = example
  @prediction = prediction
  @trace = trace
  @metrics = metrics
  @passed = passed
end

Instance Attribute Details

#exampleObject (readonly)

Returns the value of attribute example.



18
19
20
# File 'lib/dspy/evaluate.rb', line 18

def example
  @example
end

#metricsObject (readonly)

Returns the value of attribute metrics.



27
28
29
# File 'lib/dspy/evaluate.rb', line 27

def metrics
  @metrics
end

#passedObject (readonly)

Returns the value of attribute passed.



30
31
32
# File 'lib/dspy/evaluate.rb', line 30

def passed
  @passed
end

#predictionObject (readonly)

Returns the value of attribute prediction.



21
22
23
# File 'lib/dspy/evaluate.rb', line 21

def prediction
  @prediction
end

#traceObject (readonly)

Returns the value of attribute trace.



24
25
26
# File 'lib/dspy/evaluate.rb', line 24

def trace
  @trace
end

Instance Method Details

#to_hObject



50
51
52
53
54
55
56
57
58
# File 'lib/dspy/evaluate.rb', line 50

def to_h
  {
    example: @example,
    prediction: @prediction,
    trace: @trace,
    metrics: @metrics,
    passed: @passed
  }
end