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
Category
Required. The category for this rating.
[JsonPropertyName("category")]
public HarmCategory Category { get; set; }
Property Value
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
Probability
Required. The probability of harm for this content.
[JsonPropertyName("probability")]
public HarmProbability Probability { get; set; }
Property Value
ProbabilityScore
Output only. Harm probability score.
[JsonPropertyName("probabilityScore")]
public float? ProbabilityScore { get; set; }
Property Value
Severity
Output only. Harm severity levels in the content.
[JsonPropertyName("severity")]
public HarmSeverity? Severity { get; set; }
Property Value
SeverityScore
Output only. Harm severity score.
[JsonPropertyName("severityScore")]
public float? SeverityScore { get; set; }