Class YesNoQuestion
java.lang.Object
dev.langchain4j.model.decision.request.YesNoQuestion
- All Implemented Interfaces:
Question
A yes/no question, answered with the probability that the answer is "yes"
(see
YesNoAnswer).
Optionally, yesWhen() and noWhen() describe when the answer should be "yes" and when it
should be "no":
YesNoQuestion refundRequested = YesNoQuestion.builder()
.text("Does the customer ask for a refund?")
.yesWhen("The customer explicitly asks for their money back")
.noWhen("The customer only asks about a charge")
.build();
- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic YesNoQuestion.Builderbuilder()booleaninthashCode()noWhen()When the answer should be "no", ornullif not set.static YesNoQuestionCreates a yes/no question with the given text.text()What the model should evaluate, for example "Which team should handle this ticket?".toString()yesWhen()When the answer should be "yes", ornullif not set.
-
Method Details
-
text
-
yesWhen
When the answer should be "yes", ornullif not set. -
noWhen
When the answer should be "no", ornullif not set. -
of
Creates a yes/no question with the given text. -
builder
-
equals
-
hashCode
-
toString
-