Class JudgeRequest.Builder
java.lang.Object
dev.langchain4j.test.judge.JudgeRequest.Builder
- Enclosing class:
JudgeRequest
-
Method Summary
Modifier and TypeMethodDescriptionbuild()context(JudgeContext context) What the text responds to, created withJudgeContext.from(String)for a user message orJudgeContext.from(List)for a conversation.criteria(JudgeCriterion... criteria) The criteria to check the text against.criteria(Collection<JudgeCriterion> criteria) The criteria to check the text against.sources(Collection<String> sources) The sources the text should be based on, for example retrieved documents.The text to judge.
-
Method Details
-
text
The text to judge. Required. -
context
What the text responds to, created withJudgeContext.from(String)for a user message orJudgeContext.from(List)for a conversation. It lets the judge understand criteria that refer to the question or the conversation. Only the text is judged. Optional. -
sources
The sources the text should be based on, for example retrieved documents. They let the judge check criteria such as "contains only claims that are stated in the sources". -
criteria
The criteria to check the text against. Required, not empty. -
criteria
The criteria to check the text against. Required, not empty. -
build
- Throws:
IllegalArgumentException- if the text or the criteria are missing
-