Class RagChunk

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

public abstract class RagChunk extends JsonSerializable
A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
  • Constructor Details

    • RagChunk

      public RagChunk()
  • Method Details

    • pageSpan

      public abstract Optional<RagChunkPageSpan> pageSpan()
      If populated, represents where the chunk starts and ends in the document.
    • text

      public abstract Optional<String> text()
      The content of the chunk.
    • builder

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

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

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