Package com.google.genai.types
Class SafetyRating
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.SafetyRating
Safety rating corresponding to the generated content.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblocked()
Output only.static SafetyRating.Builder
builder()
Instantiates a builder for SafetyRating.abstract Optional<HarmCategory>
category()
Output only.static SafetyRating
Deserializes a JSON string to a SafetyRating object.abstract Optional<HarmBlockThreshold>
Output only.abstract Optional<HarmProbability>
Output only.Output only.abstract Optional<HarmSeverity>
severity()
Output only.Output only.abstract SafetyRating.Builder
Creates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
SafetyRating
public SafetyRating()
-
-
Method Details
-
blocked
Output only. Indicates whether the content was filtered out because of this rating. -
category
Output only. Harm category. -
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. -
probability
Output only. Harm probability levels in the content. -
probabilityScore
Output only. Harm probability score. -
severity
Output only. Harm severity levels in the content. -
severityScore
Output only. Harm severity score. -
builder
Instantiates a builder for SafetyRating. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a SafetyRating object.
-