RatingResult

@ApiStatus.Experimental
sealed interface RatingResult

The evidence a provider returned for a rating question: a selected level, a per-level distribution, a score, or any combination of these. Each part comes from the provider's response as reported. A selected level is present only when the provider selected one, and a distribution only when the provider reported one. Validation against a RatingQuestionSpec checks that a selected level and a distribution belong to the question's scale.

In JSON a rating result is an object whose status member names its class: answered, inconclusive or failure.

Inheritors

Types

Link copied to clipboard
class Answered constructor(val provenance: ModelProvenance, val selectedLevelId: String? = null, distribution: List<LevelProbability> = emptyList(), val score: RatingScore? = null, val confidence: Double? = null) : RatingResult

A rating the provider answered with at least one piece of evidence: a selected level id, a distribution over levels, a score, or a combination of these. Confidence is the provider's own measure of how concentrated its reported distribution is. It is absent unless the provider actually reports it.

Link copied to clipboard
data class Failure(val reason: FailureReason) : RatingResult

An operational failure with no raw provider error or throwable retained.

Link copied to clipboard
data class Inconclusive(val provenance: ModelProvenance) : RatingResult

Insufficient evidence to answer the rating.