Table of Contents

Class Chunk

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

A Chunk is a subpart of a Document that is treated as an independent unit for the purposes of vector representation and storage. A Corpus can have a maximum of 1 million Chunks.

public class Chunk
Inheritance
Chunk
Inherited Members
Extension Methods

Properties

CreateTime

Output only. The Timestamp of when the Chunk was created. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

[JsonPropertyName("createTime")]
public Timestamp? CreateTime { get; set; }

Property Value

Timestamp

CustomMetadata

User provided custom metadata stored as key-value pairs. The maximum number of CustomMetadata per chunk is 20.

[JsonPropertyName("customMetadata")]
public List<CustomMetadata>? CustomMetadata { get; set; }

Property Value

List<CustomMetadata>

Data

The content for the Chunk, such as the text string. The maximum number of tokens per chunk is 2043.

[JsonPropertyName("data")]
public ChunkData? Data { get; set; }

Property Value

ChunkData

Name

Immutable. Identifier. The Chunk resource name. The ID (name excluding the "corpora//documents//chunks/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c

[JsonPropertyName("name")]
public string? Name { get; set; }

Property Value

string

State

Output only. Current state of the Chunk.

[JsonPropertyName("state")]
public ChunkState? State { get; set; }

Property Value

ChunkState?

UpdateTime

Output only. The Timestamp of when the Chunk was last updated. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

[JsonPropertyName("updateTime")]
public Timestamp? UpdateTime { get; set; }

Property Value

Timestamp

See Also