Class Document

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Document

public abstract class Document extends JsonSerializable
A Document is a collection of Chunks.
  • Constructor Details

    • Document

      public Document()
  • Method Details

    • name

      public abstract Optional<String> name()
      The resource name of the Document. Example: fileSearchStores/file-search-store-foo/documents/documents-bar
    • displayName

      public abstract Optional<String> displayName()
      The human-readable display name for the Document.
    • state

      public abstract Optional<DocumentState> state()
      The current state of the Document.
    • sizeBytes

      public abstract Optional<Long> sizeBytes()
      The size of the Document in bytes.
    • mimeType

      public abstract Optional<String> mimeType()
      The MIME type of the Document.
    • createTime

      public abstract Optional<Instant> createTime()
      Output only. The Timestamp of when the `Document` was created.
    • customMetadata

      public abstract Optional<List<CustomMetadata>> customMetadata()
      Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.
    • updateTime

      public abstract Optional<Instant> updateTime()
      Output only. The Timestamp of when the `Document` was last updated.
    • builder

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

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

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