Class DecisionRequest
java.lang.Object
dev.langchain4j.model.decision.request.DecisionRequest
A request to a
DecisionModel: the input() to evaluate and the
named questions() to answer about it.
The input is either plain text or a Map of named values (strings, numbers, booleans, maps and
lists), for example a support ticket together with the customer's plan.
Every question is answered against the same input, and each answer is returned under the name of its question:
DecisionRequest request = DecisionRequest.builder()
.input(Map.of("ticket", "My payouts have been failing for 3 days", "plan", "enterprise"))
.question("team", ChoiceQuestion.builder()
.text("Which team should handle this ticket?")
.option("billing", "Payments, invoices, refunds")
.option("support", "Problems using the product")
.build())
.question("urgent", YesNoQuestion.builder()
.text("Does this need attention today?")
.build())
.build();
- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic DecisionRequest.Builderbuilder()booleaninthashCode()input()The questions to answer, keyed by name, in the order they were added.Creates a builder initialized with the input, the questions and the parameters of this request.toString()
-
Method Details
-
input
-
questions
-
parameters
-
modelName
-
builder
-
toBuilder
Creates a builder initialized with the input, the questions and the parameters of this request. -
equals
-
hashCode
-
toString
-