Package com.google.genai.types
Class RagChunk
-
- All Implemented Interfaces:
public abstract class RagChunk extends JsonSerializable
A RagChunk includes the content of a chunk of a RagFile, and associated metadata. This data type is not supported in Gemini API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classRagChunk.BuilderBuilder for RagChunk.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description RagChunk()
-
Method Summary
Modifier and Type Method Description abstract Optional<RagChunkPageSpan>pageSpan()If populated, represents where the chunk starts and ends in the document. abstract Optional<String>text()The content of the chunk. static RagChunk.Builderbuilder()Instantiates a builder for RagChunk. abstract RagChunk.BuildertoBuilder()Creates a builder with the same values as this instance. static RagChunkfromJson(String jsonString)Deserializes a JSON string to a RagChunk object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
pageSpan
abstract Optional<RagChunkPageSpan> pageSpan()
If populated, represents where the chunk starts and ends in the document.
-
builder
static RagChunk.Builder builder()
Instantiates a builder for RagChunk.
-
toBuilder
abstract RagChunk.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-