Package com.google.genai.types
Class SafetyAttributes
-
- All Implemented Interfaces:
public abstract class SafetyAttributes extends JsonSerializable
Safety attributes of a GeneratedImage or the user-provided prompt.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classSafetyAttributes.BuilderBuilder for SafetyAttributes.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description SafetyAttributes()
-
Method Summary
Modifier and Type Method Description abstract Optional<List<String>>categories()List of RAI categories. abstract Optional<List<Float>>scores()List of scores of each categories. abstract Optional<String>contentType()Internal use only. static SafetyAttributes.Builderbuilder()Instantiates a builder for SafetyAttributes. abstract SafetyAttributes.BuildertoBuilder()Creates a builder with the same values as this instance. static SafetyAttributesfromJson(String jsonString)Deserializes a JSON string to a SafetyAttributes object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
categories
abstract Optional<List<String>> categories()
List of RAI categories.
-
contentType
abstract Optional<String> contentType()
Internal use only.
-
builder
static SafetyAttributes.Builder builder()
Instantiates a builder for SafetyAttributes.
-
toBuilder
abstract SafetyAttributes.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static SafetyAttributes fromJson(String jsonString)
Deserializes a JSON string to a SafetyAttributes object.
-
-
-
-