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 class SafetyAttributes.Builder

      Builder for SafetyAttributes.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.Builder builder() Instantiates a builder for SafetyAttributes.
      abstract SafetyAttributes.Builder toBuilder() Creates a builder with the same values as this instance.
      static SafetyAttributes fromJson(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