# REST Resource: projects.locations.dataStores.branches.documents.chunks

- [Resource: Chunk](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents.chunks#Chunk)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents.chunks#Chunk.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents.chunks#METHODS_SUMMARY)

## Resource: Chunk

Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode.

| JSON representation |
|---|
| ``` { "name": string, "id": string, "content": string, "documentMetadata": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.DocumentMetadata`) }, "derivedStructData": { object }, "pageSpan": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.PageSpan`) }, "chunkMetadata": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.ChunkMetadata`) }, "dataUrls": [ string ], "annotationContents": [ string ], "annotationMetadata": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.AnnotationMetadata`) } ], "relevanceScore": number } ``` |

| Fields ||
|---|---|
| `name` | `string` The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. |
| `id` | `string` Unique chunk ID of the current chunk. |
| `content` | `string` Content is a string from a document (parsed content). |
| `documentMetadata` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.DocumentMetadata`)`` Metadata of the document from the current chunk. |
| `derivedStructData` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. |
| `pageSpan` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.PageSpan`)`` Page span of the chunk. |
| `chunkMetadata` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.ChunkMetadata`)`` Output only. Metadata of the current chunk. |
| `dataUrls[]` | `string` Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:\[\]\[;base64\], |
| `annotationContents[]` | `string` Output only. Annotation contents if the current chunk contains annotations. |
| `annotationMetadata[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk.AnnotationMetadata`)`` Output only. The annotation metadata includes structured content in the current chunk. |
| `relevanceScore` | `number` Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range \[-1.0, 1.0\]. Only populated on `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/SearchResponse`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents.chunks/get` | Gets a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.dataStores.branches.documents.chunks/list` | Gets a list of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents.chunks#Chunk`s. |