Class YesNoAnswer

java.lang.Object
org.springframework.ai.decision.answer.YesNoAnswer
All Implemented Interfaces:
DecisionAnswer

public final class YesNoAnswer extends Object implements DecisionAnswer
The answer to a YesNoQuestion: the probability that the answer is yes.
Since:
2.1.0
Author:
Thomas Vitale
  • Field Details

  • Method Details

    • builder

      public static YesNoAnswer.Builder 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

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object