Class: RubyLLM::Contract::Eval::Evaluator::Exact
- Inherits:
-
Object
- Object
- RubyLLM::Contract::Eval::Evaluator::Exact
- Defined in:
- lib/ruby_llm/contract/eval/evaluator/exact.rb
Overview
Compares output to expected using Ruby equality semantics.
Instance Method Summary collapse
-
#call(output:, expected:, input: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
Instance Method Details
#call(output:, expected:, input: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
9 10 11 12 13 14 15 16 17 |
# File 'lib/ruby_llm/contract/eval/evaluator/exact.rb', line 9 def call(output:, expected:, input: nil) # rubocop:disable Lint/UnusedMethodArgument return EvaluationResult.new(score: 1.0, passed: true, details: "exact match") if output == expected EvaluationResult.new( score: 0.0, passed: false, details: "expected #{expected.inspect}, got #{output.inspect}" ) end |