Interface JudgeContext
- All Known Implementing Classes:
ConversationContext, UserMessageContext
What the judged text responds to: either the user message (
UserMessageContext) or the whole conversation
(ConversationContext). It lets the judge understand criteria that refer to the question or to the
conversation. Only the text is judged, never the context.
JudgeContext question = JudgeContext.from("Where is my booking?");
JudgeContext conversation = JudgeContext.from(chatRequest.messages());
The judges of this package support only these two implementations.-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic UserMessageContextCreates a context with the text of the user message that the judged text responds to.static ConversationContextfrom(List<? extends ChatMessage> conversation) Creates a context with the conversation that the judged text answers, for example the messages of the last request an AI Service sent to the chat model.
-
Method Details
-
from
Creates a context with the text of the user message that the judged text responds to.- Throws:
IllegalArgumentException- if the user message is blank
-
from
Creates a context with the conversation that the judged text answers, for example the messages of the last request an AI Service sent to the chat model.- Throws:
IllegalArgumentException- if the conversation is empty or containsnull
-