Interface JudgeContext

All Known Implementing Classes:
ConversationContext, UserMessageContext

@Experimental public interface JudgeContext
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 Methods
    Modifier and Type
    Method
    Description
    from(String userMessage)
    Creates a context with the text of the user message that the judged text responds to.
    from(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