ModerationResult
data class ModerationResult(val flagged: Boolean = false, val categories: Map<ModerationCategory, Boolean> = emptyMap(), val categoryScores: Map<ModerationCategory, Double> = emptyMap(), val categoryAppliedInputTypes: Map<ModerationCategory, List<InputType>> = emptyMap())(source)
Represents the result of a moderation check performed by the OpenAI moderation endpoint.
Constructors
Link copied to clipboard
constructor(flagged: Boolean = false, categories: Map<ModerationCategory, Boolean> = emptyMap(), categoryScores: Map<ModerationCategory, Double> = emptyMap(), categoryAppliedInputTypes: Map<ModerationCategory, List<InputType>> = emptyMap())
Properties
Link copied to clipboard
A map where the keys are moderation categories and the values indicate if the category was triggered.
Link copied to clipboard
A map of moderation categories to the list of input types the category and score apply to.
Link copied to clipboard
A map of moderation categories to their respective confidence scores.
Link copied to clipboard
Indicates whether the input was flagged based on the moderation categories.