class Riffer::Evals::ScenarioResult
Represents the result of evaluating a single scenario.
Attributes
The ground truth used during evaluation.
The input that was evaluated.
The full message history from the agent conversation.
The agent output for this scenario.
Individual evaluation results.
Public Class Methods
Source
# File lib/riffer/evals/scenario_result.rb, line 23 def initialize(input:, output:, ground_truth:, results:, messages: []) @input = input @output = output @ground_truth = ground_truth @results = results @messages = messages end
Public Instance Methods
Source
# File lib/riffer/evals/scenario_result.rb, line 35 def scores acc = {} #: Hash[singleton(Riffer::Evals::Evaluator), Float] results.each_with_object(acc) do |result, hash| hash[result.evaluator] = result.score end end
Returns scores keyed by evaluator class.
Source
# File lib/riffer/evals/scenario_result.rb, line 46 def to_h { input: input, output: output, ground_truth: ground_truth, scores: scores.transform_keys(&:name), results: results.map(&:to_h), messages: messages.map(&:to_h) } end
Returns a hash representation of the scenario result.