Class JudgeVerdict
java.lang.Object
dev.langchain4j.test.judge.JudgeVerdict
The verdict of a
Judge on one JudgeCriterion. Returned by Judge.evaluate(JudgeRequest).
Implementations of Judge create verdicts with from(JudgeCriterion, boolean, String).-
Method Summary
Modifier and TypeMethodDescriptionThe criterion this verdict is about.booleanA human-readable explanation of the verdict: the judge's reasoning for aChatModelJudge, the probability and threshold for aDecisionModelJudge.static JudgeVerdictfrom(JudgeCriterion criterion, boolean satisfied, String explanation) Creates a verdict without a probability, for example in aJudgeimplementation.static JudgeVerdictfrom(JudgeCriterion criterion, boolean satisfied, String explanation, double probability) Creates a verdict with the probability, from 0 to 1, that the criterion is satisfied, for example in aJudgeimplementation.inthashCode()booleanWhether the judge considers the criterion satisfied.The probability, from 0 to 1, that the criterion is satisfied, as answered by aDecisionModelJudge, ornullif the judge does not provide one, for example aChatModelJudge.toString()
-
Method Details
-
from
Creates a verdict without a probability, for example in aJudgeimplementation.- Parameters:
criterion- the criterion the verdict is aboutsatisfied- whether the criterion is satisfiedexplanation- a human-readable explanation of the verdict
-
from
public static JudgeVerdict from(JudgeCriterion criterion, boolean satisfied, String explanation, double probability) Creates a verdict with the probability, from 0 to 1, that the criterion is satisfied, for example in aJudgeimplementation.- Parameters:
criterion- the criterion the verdict is aboutsatisfied- whether the criterion is satisfiedexplanation- a human-readable explanation of the verdictprobability- the probability that the criterion is satisfied, from 0 to 1
-
criterion
The criterion this verdict is about. -
isSatisfied
public boolean isSatisfied()Whether the judge considers the criterion satisfied. A criterion the judge was not sure about is not satisfied. -
explanation
A human-readable explanation of the verdict: the judge's reasoning for aChatModelJudge, the probability and threshold for aDecisionModelJudge. -
probability
The probability, from 0 to 1, that the criterion is satisfied, as answered by aDecisionModelJudge, ornullif the judge does not provide one, for example aChatModelJudge. -
equals
-
hashCode
-
toString
-