Class ScaleQuestion
java.lang.Object
dev.langchain4j.model.decision.request.ScaleQuestion
- All Implemented Interfaces:
Question
A question that places the input on an ordered scale, answered with the mean level and the probability of each level
(see
ScaleAnswer).
Levels are described with text and ordered from lowest to highest; a level's number is its index, starting at 0:
ScaleQuestion frustration = ScaleQuestion.builder()
.text("How frustrated is the customer?")
.level("Calm") // 0
.level("Frustrated") // 1
.level("Angry", "Uses insults or threatens to cancel") // 2
.build();
A level can have a description of when it applies, in addition to its label.- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ScaleQuestion.Builderbuilder()booleaninthashCode()The descriptions of the levels, in the same order aslevels(): the description of when a level applies, ornullfor a level without description.levels()The levels, from lowest (index 0) to highest.static ScaleQuestionCreates a scale question with the given text and levels, ordered from lowest to highest.text()What the model should evaluate, for example "Which team should handle this ticket?".toString()
-
Method Details
-
text
-
levels
-
levelDescriptions
-
of
Creates a scale question with the given text and levels, ordered from lowest to highest. -
builder
-
equals
-
hashCode
-
toString
-