Class YesNoAnswer
java.lang.Object
org.springframework.ai.decision.answer.YesNoAnswer
- All Implemented Interfaces:
DecisionAnswer
The answer to a
YesNoQuestion: the probability that the answer is yes.- Since:
- 2.1.0
- Author:
- Thomas Vitale
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic YesNoAnswer.Builderbuilder()booleandoubleThe probability, between 0 and 1, that the answer is yes.inthashCode()booleanisYes()Whether the answer is yes, that is, the probability is at least 0.5.booleanisYes(double threshold) Whether the probability is at least the given threshold.toString()
-
Field Details
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDThe thresholdisYes()applies.- See Also:
-
-
Method Details
-
builder
-
getProbability
public double getProbability()The probability, between 0 and 1, that the answer is yes. -
isYes
public boolean isYes()Whether the answer is yes, that is, the probability is at least 0.5. -
isYes
public boolean isYes(double threshold) Whether the probability is at least the given threshold. -
equals
-
hashCode
public int hashCode() -
toString
-