Class GeneratedImage

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

public abstract class GeneratedImage extends JsonSerializable
An output image.
  • Constructor Details

    • GeneratedImage

      public GeneratedImage()
  • Method Details

    • image

      public abstract Optional<Image> image()
      The output image data.
    • raiFilteredReason

      public abstract Optional<String> raiFilteredReason()
      Responsible AI filter reason if the image is filtered out of the response.
    • safetyAttributes

      public abstract Optional<SafetyAttributes> safetyAttributes()
      Safety attributes of the image. Lists of RAI categories and their scores of each content.
    • enhancedPrompt

      public abstract Optional<String> enhancedPrompt()
      The rewritten prompt used for the image generation if the prompt enhancer is enabled.
    • builder

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

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

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