answerableProbability property

double? answerableProbability
final

Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages.

A low answerable_probability indicates that the answer might not be grounded in the sources.

When answerable_probability is low, you may want to:

  • Display a message to the effect of "We couldn’t answer that question" to the user.
  • Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. 0.5 is a good starting threshold.

Implementation

final double? answerableProbability;