Class FileCitation

java.lang.Object
com.google.genai.gaos.models.interactions.FileCitation
All Implemented Interfaces:
Annotation

public class FileCitation extends Object implements Annotation
FileCitation

A file citation annotation.

  • Constructor Details

    • FileCitation

      public FileCitation(@Nullable Map<String,Object> customMetadata, @Nullable String documentUri, @Nullable Integer endIndex, @Nullable String fileName, @Nullable String mediaId, @Nullable Integer pageNumber, @Nullable String source, @Nullable Integer startIndex)
    • FileCitation

      public FileCitation()
  • Method Details

    • customMetadata

      public Optional<Map<String,Object>> customMetadata()
      User provided metadata about the retrieved context.
    • documentUri

      public Optional<String> documentUri()
      The URI of the file.
    • endIndex

      public Optional<Integer> endIndex()
      End of the attributed segment, exclusive.
    • fileName

      public Optional<String> fileName()
      The name of the file.
    • mediaId

      public Optional<String> mediaId()
      Media ID in-case of image citations, if applicable.
    • pageNumber

      public Optional<Integer> pageNumber()
      Page number of the cited document, if applicable.
    • source

      public Optional<String> source()
      Source attributed for a portion of the text.
    • startIndex

      public Optional<Integer> startIndex()
      Start of segment of the response that is attributed to this source.

      Index indicates the start of the segment, measured in bytes.

    • type

      public String type()
      Specified by:
      type in interface Annotation
    • builder

      public static FileCitation.Builder builder()
    • withCustomMetadata

      public FileCitation withCustomMetadata(@Nullable Map<String,Object> customMetadata)
      User provided metadata about the retrieved context.
    • withDocumentUri

      public FileCitation withDocumentUri(@Nullable String documentUri)
      The URI of the file.
    • withEndIndex

      public FileCitation withEndIndex(@Nullable Integer endIndex)
      End of the attributed segment, exclusive.
    • withFileName

      public FileCitation withFileName(@Nullable String fileName)
      The name of the file.
    • withMediaId

      public FileCitation withMediaId(@Nullable String mediaId)
      Media ID in-case of image citations, if applicable.
    • withPageNumber

      public FileCitation withPageNumber(@Nullable Integer pageNumber)
      Page number of the cited document, if applicable.
    • withSource

      public FileCitation withSource(@Nullable String source)
      Source attributed for a portion of the text.
    • withStartIndex

      public FileCitation withStartIndex(@Nullable Integer startIndex)
      Start of segment of the response that is attributed to this source.

      Index indicates the start of the segment, measured in bytes.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object