Class DecisionRequest

java.lang.Object
dev.langchain4j.model.decision.request.DecisionRequest

@Experimental public final class DecisionRequest extends Object
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