Class SafetyAttributes

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.SafetyAttributes

public abstract class SafetyAttributes extends JsonSerializable
Safety attributes of a GeneratedImage or the user-provided prompt.
  • Constructor Details

    • SafetyAttributes

      public SafetyAttributes()
  • Method Details

    • categories

      public abstract Optional<List<String>> categories()
      List of RAI categories.
    • scores

      public abstract Optional<List<Float>> scores()
      List of scores of each categories.
    • contentType

      public abstract Optional<String> contentType()
      Internal use only.
    • builder

      public static SafetyAttributes.Builder builder()
      Instantiates a builder for SafetyAttributes.
    • toBuilder

      public abstract SafetyAttributes.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static SafetyAttributes fromJson(String jsonString)
      Deserializes a JSON string to a SafetyAttributes object.