Class DecisionRequest.Builder
java.lang.Object
dev.langchain4j.model.decision.request.DecisionRequest.Builder
- Enclosing class:
DecisionRequest
- Since:
- 1.21.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()input(DecisionInput input) Sets the input to evaluate.Sets the input to evaluate as text.inputContents(Content... contents) Sets the input to evaluate as contents, seeinputContents(List).inputContents(List<? extends Content> contents) Sets the input to evaluate as a list of contents, for example aTextContentand anImageContent.inputFields(Map<String, ?> fields) Sets the input to evaluate as named fields, for exampleMap.of("ticket", ticket, "plan", "enterprise").inputMessages(ChatMessage... messages) Sets the input to evaluate as a conversation, seeinputMessages(List).inputMessages(List<? extends ChatMessage> messages) Sets the input to evaluate as a conversation: messages in the order they were exchanged, for example a chat between a user and an AI assistant, including the tools the assistant called (AiMessage.toolExecutionRequests()) and their results (ToolExecutionResultMessage).parameters(DecisionRequestParameters parameters) Adds a question.Replaces all questions.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
input
Sets the input to evaluate as text. Replaces any input set before. -
inputFields
Sets the input to evaluate as named fields, for exampleMap.of("ticket", ticket, "plan", "enterprise"). SeeFieldsInputfor the supported values. Replaces any input set before.- Since:
- 1.23.0
-
inputContents
Sets the input to evaluate as a list of contents, for example aTextContentand anImageContent. Which kinds of contents are supported depends on the decision model. Replaces any input set before.- Since:
- 1.23.0
-
inputContents
Sets the input to evaluate as contents, seeinputContents(List).- Since:
- 1.23.0
-
inputMessages
Sets the input to evaluate as a conversation: messages in the order they were exchanged, for example a chat between a user and an AI assistant, including the tools the assistant called (AiMessage.toolExecutionRequests()) and their results (ToolExecutionResultMessage). This lets you ask questions about the whole conversation, for example whether the assistant answered the user's question, or whether a tool call is safe to execute. Messages and tool results can contain text written to influence the decision (prompt injection): do not rely on a decision alone to allow a dangerous action. Which kinds of messages and contents are supported depends on the decision model. Replaces any input set before.- Since:
- 1.23.0
-
inputMessages
Sets the input to evaluate as a conversation, seeinputMessages(List).- Since:
- 1.23.0
-
input
Sets the input to evaluate. Replaces any input set before.- Since:
- 1.23.0
-
questions
Replaces all questions. -
question
Adds a question. Its answer is returned under the same name, so question names must be unique. -
parameters
-
build
-