SafetyRating

@Serializable
data class SafetyRating(val blocked: Boolean? = null, val category: HarmCategory? = null, val overwrittenThreshold: HarmBlockThreshold? = null, val probability: HarmProbability? = null, val probabilityScore: Double? = null, val severity: HarmSeverity? = null, val severityScore: Double? = null)

A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.

Constructors

Link copied to clipboard
constructor(blocked: Boolean? = null, category: HarmCategory? = null, overwrittenThreshold: HarmBlockThreshold? = null, probability: HarmProbability? = null, probabilityScore: Double? = null, severity: HarmSeverity? = null, severityScore: Double? = null)

Properties

Link copied to clipboard
val blocked: Boolean? = null

Output only. Indicates whether the content was blocked because of this rating.

Link copied to clipboard
val category: HarmCategory? = null

Output only. The harm category of this rating.

Link copied to clipboard

Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.

Link copied to clipboard

Output only. The probability of harm for this category.

Link copied to clipboard

Output only. The probability score of harm for this category. This field is not supported in Gemini API.

Link copied to clipboard
val severity: HarmSeverity? = null

Output only. The severity of harm for this category. This field is not supported in Gemini API.

Link copied to clipboard
val severityScore: Double? = null

Output only. The severity score of harm for this category. This field is not supported in Gemini API.