Class ChoiceAnswer
java.lang.Object
org.springframework.ai.decision.answer.ChoiceAnswer
- All Implemented Interfaces:
DecisionAnswer
The answer to a
ChoiceQuestion: the selected option, the probability of each
option when the provider reports them, and the provider's confidence when it reports
one. Probabilities are what the model assigned to each option. Confidence is the
provider's own estimate and is not a probability of correctness.- Since:
- 2.1.0
- Author:
- Thomas Vitale, Christian Tzolov
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ChoiceAnswer.Builderbuilder()boolean@Nullable DoubleThe provider's confidence in the selected option, ornullwhen the provider doesn't report one.The probability of each option, or an empty map when the provider doesn't report them.@Nullable DoubleThe probability of the selected option, ornullwhen not reported.@Nullable DoublegetProbability(String option) The probability of the given option, ornullwhen not reported.The options from the most to the least likely, or an empty list when probabilities weren't reported.getValue()The selected option.inthashCode()toString()
-
Method Details
-
builder
-
getValue
The selected option. -
getProbability
The probability of the selected option, ornullwhen not reported. -
getProbability
The probability of the given option, ornullwhen not reported. -
getProbabilities
The probability of each option, or an empty map when the provider doesn't report them. -
getRankedOptions
The options from the most to the least likely, or an empty list when probabilities weren't reported. Ties keep the reported order. -
getConfidence
The provider's confidence in the selected option, ornullwhen the provider doesn't report one. -
equals
-
hashCode
public int hashCode() -
toString
-