Record Class ItemResult

java.lang.Object
java.lang.Record
dev.dokimos.core.ItemResult
Record Components:
example - the example that was executed
actualOutputs - the outputs the task produced, never null (empty map if absent)
evalResults - the evaluator results, never null (empty list if absent)
metrics - optional metrics for the underlying LLM call, or null if not measured

public record ItemResult(Example example, Map<String,Object> actualOutputs, List<EvalResult> evalResults, CallMetrics metrics) extends Record
The outcome of executing a single example: the example itself, the actual outputs the task produced, the evaluator results, and optional metrics describing the underlying LLM call.
  • Constructor Details

    • ItemResult

      public ItemResult(Example example, Map<String,Object> actualOutputs, List<EvalResult> evalResults, CallMetrics metrics)
      Creates an instance of a ItemResult record class.
      Parameters:
      example - the value for the example record component
      actualOutputs - the value for the actualOutputs record component
      evalResults - the value for the evalResults record component
      metrics - the value for the metrics record component
    • ItemResult

      public ItemResult(Example example, Map<String,Object> actualOutputs, List<EvalResult> evalResults)
      Creates a result without call metrics.
      Parameters:
      example - the example that was executed
      actualOutputs - the outputs the task produced
      evalResults - the evaluator results
  • Method Details

    • success

      public boolean success()
    • toTestCase

      public EvalTestCase toTestCase()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • example

      public Example example()
      Returns the value of the example record component.
      Returns:
      the value of the example record component
    • actualOutputs

      public Map<String,Object> actualOutputs()
      Returns the value of the actualOutputs record component.
      Returns:
      the value of the actualOutputs record component
    • evalResults

      public List<EvalResult> evalResults()
      Returns the value of the evalResults record component.
      Returns:
      the value of the evalResults record component
    • metrics

      public CallMetrics metrics()
      Returns the value of the metrics record component.
      Returns:
      the value of the metrics record component