Package com.google.genai.types
Class GeneratedImage
-
- All Implemented Interfaces:
public abstract class GeneratedImage extends JsonSerializable
An output image.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classGeneratedImage.BuilderBuilder for GeneratedImage.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description GeneratedImage()
-
Method Summary
Modifier and Type Method Description abstract Optional<Image>image()The output image data. abstract Optional<String>raiFilteredReason()Responsible AI filter reason if the image is filtered out of the response. abstract Optional<SafetyAttributes>safetyAttributes()Safety attributes of the image. abstract Optional<String>enhancedPrompt()The rewritten prompt used for the image generation if the prompt enhancer is enabled. static GeneratedImage.Builderbuilder()Instantiates a builder for GeneratedImage. abstract GeneratedImage.BuildertoBuilder()Creates a builder with the same values as this instance. static GeneratedImagefromJson(String jsonString)Deserializes a JSON string to a GeneratedImage 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
-
raiFilteredReason
abstract Optional<String> raiFilteredReason()
Responsible AI filter reason if the image is filtered out of the response.
-
safetyAttributes
abstract Optional<SafetyAttributes> safetyAttributes()
Safety attributes of the image. Lists of RAI categories and their scores of each content.
-
enhancedPrompt
abstract Optional<String> enhancedPrompt()
The rewritten prompt used for the image generation if the prompt enhancer is enabled.
-
builder
static GeneratedImage.Builder builder()
Instantiates a builder for GeneratedImage.
-
toBuilder
abstract GeneratedImage.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static GeneratedImage fromJson(String jsonString)
Deserializes a JSON string to a GeneratedImage object.
-
-
-
-