Class GroundingChunkRetrievedContext

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

public abstract class GroundingChunkRetrievedContext extends JsonSerializable
Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. This data type is not supported in Gemini API.
  • Constructor Details

    • GroundingChunkRetrievedContext

      public GroundingChunkRetrievedContext()
  • Method Details

    • documentName

      public abstract Optional<String> documentName()
      Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
    • ragChunk

      public abstract Optional<RagChunk> ragChunk()
      Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
    • text

      public abstract Optional<String> text()
      The content of the retrieved data source.
    • title

      public abstract Optional<String> title()
      The title of the retrieved data source.
    • uri

      public abstract Optional<String> uri()
      The URI of the retrieved data source.
    • builder

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

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

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