Class Blob


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.
  • Constructor Details

    • Blob

      public Blob()
  • Method Details

    • data

      public abstract Optional<byte[]> data()
      Required. The raw bytes of the data.
    • displayName

      public 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

      public abstract Optional<String> mimeType()
      Required. The IANA standard MIME type of the source data.
    • builder

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

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

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