Record Class EvaluationSample
java.lang.Object
java.lang.Record
io.micronaut.langchain4j.test.EvaluationSample
- Record Components:
name- The name of the sample, shown in the test reportsinput- The input sent to the AI servicecontext- The context that the response must be grounded in, if anyexpected- The expected response, if any
public record EvaluationSample(String name, String input, @Nullable String context, @Nullable String expected)
extends Record
A sample of an evaluation: the input sent to the AI service, with the optional context that the response must be
grounded in and the optional expected response, loaded from a sample file by
EvaluationSamples.- Since:
- 2.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluationSample(String name, String input, @Nullable String context, @Nullable String expected) Creates an instance of aEvaluationSamplerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringcontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Stringexpected()Returns the value of theexpectedrecord component.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.name()Returns the value of thenamerecord component.Creates the request that evaluates the response to this sample.toString()Returns a string representation of this record class.
-
Constructor Details
-
EvaluationSample
-
-
Method Details
-
request
Creates the request that evaluates the response to this sample.- Parameters:
response- The response of the AI service- Returns:
- The evaluation request
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
name
-
input
-
context
-
expected
-