Package com.google.genai.types
Class Image
-
- All Implemented Interfaces:
public abstract class Image extends JsonSerializable
An image.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classImage.BuilderBuilder for Image.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description Image()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>gcsUri()The Cloud Storage URI of the image. abstract Optional<Array<byte>>imageBytes()The image bytes data. abstract Optional<String>mimeType()The MIME type of the image. static Image.Builderbuilder()Instantiates a builder for Image. abstract Image.BuildertoBuilder()Creates a builder with the same values as this instance. static ImagefromJson(String jsonString)Deserializes a JSON string to a Image object. static ImagefromFile(String location)Creates an Image object from a local file. static ImagefromFile(String location, String mimeType)Creates an Image object from a local file and mime type. -
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
-
gcsUri
abstract Optional<String> 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
abstract Optional<Array<byte>> imageBytes()
The image bytes data. ``Image`` can contain a value for this field or the ``gcs_uri`` field but not both.
-
builder
static Image.Builder builder()
Instantiates a builder for Image.
-
toBuilder
abstract Image.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromFile
static Image fromFile(String location)
Creates an Image object from a local file.
If mimeType is not specified, it will be inferred from the file extension.
-
-
-
-