Class ScaleAnswer
java.lang.Object
dev.langchain4j.model.decision.response.ScaleAnswer
- All Implemented Interfaces:
DecisionAnswer
The answer to a
ScaleQuestion: the mean level, the probability of each
level and, if the model reports one, a confidence.- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ScaleAnswer.Builderbuilder()How confident the model is inmean(), from 0 to 1, ornullif the model does not report a confidence.booleaninthashCode()doublemean()The probability-weighted mean of the level indexes, from 0 (the lowest level) ton - 1(the highest level).The probability of each level, indexed likeScaleQuestion.levels().toString()
-
Method Details
-
mean
public double mean()The probability-weighted mean of the level indexes, from 0 (the lowest level) ton - 1(the highest level). It can fall between two levels: with levels "Calm", "Frustrated" and "Angry", a mean of 1.4 means "between frustrated and angry, closer to frustrated". -
probabilities
The probability of each level, indexed likeScaleQuestion.levels(). Empty if the model does not report probabilities. -
confidence
-
builder
-
equals
-
hashCode
-
toString
-