Package com.google.genai.types
Class Blob
-
- All Implemented Interfaces:
public abstract class Blob extends JsonSerializable
A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classBlob.BuilderBuilder for Blob.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description Blob()
-
Method Summary
Modifier and Type Method Description abstract Optional<Array<byte>>data()Required. abstract Optional<String>displayName()Optional. abstract Optional<String>mimeType()Required. static Blob.Builderbuilder()Instantiates a builder for Blob. abstract Blob.BuildertoBuilder()Creates a builder with the same values as this instance. static BlobfromJson(String jsonString)Deserializes a JSON string to a Blob 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
-
displayName
abstract Optional<String> displayName()
Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.
-
mimeType
abstract Optional<String> mimeType()
Required. The IANA standard MIME type of the source data.
-
builder
static Blob.Builder builder()
Instantiates a builder for Blob.
-
toBuilder
abstract Blob.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-