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 one of:

Not every decision model supports every kind of input: a model that does not support it throws an UnsupportedFeatureException. Every question is answered against the same input, and each answer is returned under the name of its question:
DecisionRequest request = DecisionRequest.builder()
        .inputFields(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