Interface SafetyRating

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

interface SafetyRating {
    blocked?: boolean;
    category?: HarmCategory;
    overwrittenThreshold?: HarmBlockThreshold;
    probability?: HarmProbability;
    probabilityScore?: number;
    severity?: HarmSeverity;
    severityScore?: number;
}

Properties

blocked?: boolean

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

category?: HarmCategory

Output only. The harm category of this rating.

overwrittenThreshold?: HarmBlockThreshold

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.

probability?: HarmProbability

Output only. The probability of harm for this category.

probabilityScore?: number

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

severity?: HarmSeverity

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

severityScore?: number

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