The answer to a question built with TypeSafe.choice/2.
:choiceis the selected string label from the question's criteria.:probabilitiesmaps every criterion label to a number from 0 to 1.:confidenceis a number from 0 to 1 supplied by the service and derived from the distribution. It is distinct from the selected label's probability.
These values are model outputs, not a measured guarantee of correctness. Choose routing thresholds using examples from your application.
Given a response containing a question named "team":
%TypeSafe.Answer.Choice{choice: team, probabilities: probabilities} =
response.answers["team"]
selected_probability = Map.fetch!(probabilities, team)