Class RagChunk
A RagChunk includes the content of a chunk of a RagFile, and associated metadata. This data type is not supported in Gemini API.
public record RagChunk : IEquatable<RagChunk>
- Inheritance
-
RagChunk
- Implements
- Inherited Members
Properties
ChunkId
The ID of the chunk.
[JsonPropertyName("chunkId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ChunkId { get; set; }
Property Value
FileId
The ID of the file that the chunk belongs to.
[JsonPropertyName("fileId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FileId { get; set; }
Property Value
PageSpan
If populated, represents where the chunk starts and ends in the document.
[JsonPropertyName("pageSpan")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public RagChunkPageSpan? PageSpan { get; set; }
Property Value
Text
The content of the chunk.
[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Text { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a RagChunk object.
public static RagChunk? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- RagChunk
The deserialized RagChunk object, or null if deserialization fails.