Table of Contents

Class SafetyRating

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.

public class SafetyRating
Inheritance
SafetyRating
Inherited Members
Extension Methods

Properties

Blocked

Was this content blocked because of this rating?

[JsonPropertyName("blocked")]
public bool Blocked { get; set; }

Property Value

bool

Category

Required. The category for this rating.

[JsonPropertyName("category")]
public HarmCategory Category { get; set; }

Property Value

HarmCategory

OverwrittenThreshold

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.

[JsonPropertyName("overwrittenThreshold")]
public HarmBlockThreshold? OverwrittenThreshold { get; set; }

Property Value

HarmBlockThreshold?

Probability

Required. The probability of harm for this content.

[JsonPropertyName("probability")]
public HarmProbability Probability { get; set; }

Property Value

HarmProbability

ProbabilityScore

Output only. Harm probability score.

[JsonPropertyName("probabilityScore")]
public float? ProbabilityScore { get; set; }

Property Value

float?

Severity

Output only. Harm severity levels in the content.

[JsonPropertyName("severity")]
public HarmSeverity? Severity { get; set; }

Property Value

HarmSeverity?

SeverityScore

Output only. Harm severity score.

[JsonPropertyName("severityScore")]
public float? SeverityScore { get; set; }

Property Value

float?

See Also