Class YesNoQuestion

java.lang.Object
org.springframework.ai.decision.question.YesNoQuestion
All Implemented Interfaces:
DecisionQuestion

public final class YesNoQuestion extends Object implements DecisionQuestion
A question with a yes or no answer, answered with the probability of "yes" as a YesNoAnswer. The optional criteria describe when the answer is yes and when it is no; a blank criterion counts as none. Providers whose API has a place for them send them as such, the others add them to the question text.
Since:
2.1.0
Author:
Thomas Vitale
  • Method Details

    • of

      public static YesNoQuestion of(String text)
      A question without criteria.
    • builder

      public static YesNoQuestion.Builder builder()
    • getText

      public String getText()
      Description copied from interface: DecisionQuestion
      The question text, which tells the model what to decide.
      Specified by:
      getText in interface DecisionQuestion
    • getWhenYes

      public @Nullable String getWhenYes()
      When the answer is yes, or null when not specified or blank.
    • getWhenNo

      public @Nullable String getWhenNo()
      When the answer is no, or null when not specified or blank.
    • 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