Record Class EvaluationRequest
java.lang.Object
java.lang.Record
io.micronaut.langchain4j.evaluation.EvaluationRequest
- Record Components:
userText- The original user textcontext- The optional grounding contextresponse- The generated response
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluationRequest(@NonNull String userText, @Nullable String context, @NonNull String response) Creates an instance of aEvaluationRequestrecord 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.static @NonNull EvaluationRequestCreates an evaluation request from the user text and AI service result.static @NonNull EvaluationRequestfrom(@NonNull String userText, @NonNull List<dev.langchain4j.rag.content.Content> sources, @NonNull String response) Creates an evaluation request from the user text, retrieved sources, and generated response.final inthashCode()Returns a hash code value for this object.@NonNull Stringresponse()Returns the value of theresponserecord component.final StringtoString()Returns a string representation of this record class.@NonNull StringuserText()Returns the value of theuserTextrecord component.
-
Constructor Details
-
EvaluationRequest
-
-
Method Details
-
from
public static @NonNull EvaluationRequest from(@NonNull String userText, @NonNull dev.langchain4j.service.Result<?> result) Creates an evaluation request from the user text and AI service result.- Parameters:
userText- The original user textresult- The AI service result- Returns:
- The evaluation request
- Since:
- 2.1.1
-
from
public static @NonNull EvaluationRequest from(@NonNull String userText, @NonNull List<dev.langchain4j.rag.content.Content> sources, @NonNull String response) Creates an evaluation request from the user text, retrieved sources, and generated response.- Parameters:
userText- The original user textsources- The retrieved sourcesresponse- The generated response- Returns:
- The evaluation request
- Since:
- 2.1.1
-
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). -
userText
-
context
-
response
-