Join the Gemini API Developer Competition!
Learn more
Send feedback
google.ai.generativelanguage.Chunk
Stay organized with collections
Save and categorize content based on your preferences.
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 Chunk
\ s.
Attributes
name
str
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
data
google.ai.generativelanguage.ChunkData
Required. The content for the Chunk
, such as the text
string. The maximum number of tokens per chunk is 2043.
custom_metadata
MutableSequence[google.ai.generativelanguage.CustomMetadata]
Optional. User provided custom metadata stored as key-value
pairs. The maximum number of CustomMetadata
per chunk is
20.
create_time
google.protobuf.timestamp_pb2.Timestamp
Output only. The Timestamp of when the Chunk
was
created.
update_time
google.protobuf.timestamp_pb2.Timestamp
Output only. The Timestamp of when the Chunk
was last
updated.
state
google.ai.generativelanguage.Chunk.State
Output only. Current state of the Chunk
.
Child Classes
class State
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-14 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?