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()booleanstatic YesNoAnswerfrom(double probability) Creates an answer with the given probability of "yes", from 0 to 1.inthashCode()booleanisYes(double threshold) Returnstrueif the probability of "yes" is greater than or equal to the given threshold.static YesNoAnswerof(double probability) Deprecated, for removal: This API element is subject to removal in a future version.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. -
from
Creates an answer with the given probability of "yes", from 0 to 1.- Since:
- 1.23.0
-
of
Deprecated, for removal: This API element is subject to removal in a future version.usefrom(double)insteadCreates an answer with the given probability of "yes", from 0 to 1. -
builder
-
equals
-
hashCode
-
toString
-
from(double)instead