Class YesNoAnswer
java.lang.Object
dev.langchain4j.model.decision.response.YesNoAnswer
- All Implemented Interfaces:
DecisionAnswer
The answer to a
YesNoQuestion: the probability() that the
answer is "yes".- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic YesNoAnswer.Builderbuilder()booleaninthashCode()booleanisYes(double threshold) Returnstrueif the probability of "yes" is greater than or equal to the given threshold.static YesNoAnswerof(double probability) Creates an answer with the given probability of "yes", from 0 to 1.doubleThe probability that the answer is "yes", from 0 (certainly "no") to 1 (certainly "yes").toString()
-
Method Details
-
probability
public double probability()The probability that the answer is "yes", from 0 (certainly "no") to 1 (certainly "yes"). -
isYes
public boolean isYes(double threshold) Returnstrueif the probability of "yes" is greater than or equal to the given threshold. -
of
Creates an answer with the given probability of "yes", from 0 to 1. -
builder
-
equals
-
hashCode
-
toString
-