Package com.google.genai.types
Class Image
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Image
An image.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Image.Builder
builder()
Instantiates a builder for Image.static Image
Creates an Image object from a local file.static Image
Creates an Image object from a local file and mime type.static Image
Deserializes a JSON string to a Image object.gcsUri()
The Cloud Storage URI of the image.abstract Optional<byte[]>
The image bytes data.mimeType()
The MIME type of the image.abstract Image.Builder
Creates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
Image
public Image()
-
-
Method Details
-
gcsUri
The Cloud Storage URI of the image. ``Image`` can contain a value for this field or the ``image_bytes`` field but not both. -
imageBytes
The image bytes data. ``Image`` can contain a value for this field or the ``gcs_uri`` field but not both. -
mimeType
The MIME type of the image. -
builder
Instantiates a builder for Image. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Image object. -
fromFile
Creates an Image object from a local file.If mimeType is not specified, it will be inferred from the file extension.
-
fromFile
Creates an Image object from a local file and mime type.
-