Package org.springframework.ai.decision
Class DecisionResponse.Builder
java.lang.Object
org.springframework.ai.decision.DecisionResponse.Builder
- Enclosing class:
- DecisionResponse
Builds a
DecisionResponse that answers a DecisionPrompt.-
Method Summary
Modifier and TypeMethodDescriptionanswer(String name, DecisionAnswer answer) Add the answer to a question.answer(String name, DecisionAnswer answer, DecisionResultMetadata metadata) Add the answer to a question, with metadata about that answer.answers(Map<String, ? extends DecisionAnswer> answers) build()Build the response, with the results in the order of the prompt's questions.metadata(DecisionResponseMetadata metadata)
-
Method Details
-
answer
Add the answer to a question. -
answer
public DecisionResponse.Builder answer(String name, DecisionAnswer answer, DecisionResultMetadata metadata) Add the answer to a question, with metadata about that answer. -
answers
-
metadata
-
build
Build the response, with the results in the order of the prompt's questions. Fails when a question has no answer, an answer has no question, or an answer doesn't match its question: a wrong type, a choice outside the offered options, or a score outside the levels. A refusal is accepted for any question.
-