Method: corpora.documents.chunks.batchCreate

Batch create Chunks.

HTTP request

POST https://generativelanguage.googleapis.com/v1beta/{parent=corpora/*/documents/*}/chunks:batchCreate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Optional. The name of the Document where this batch of Chunks will be created. The parent field in every CreateChunkRequest must match this value. Example: corpora/my-corpus-123/documents/the-doc-abc

Request body

The request body contains data with the following structure:

JSON representation
{
  "requests": [
    {
      object (CreateChunkRequest)
    }
  ]
}
Fields
requests[]

object (CreateChunkRequest)

Required. The request messages specifying the Chunks to create. A maximum of 100 Chunks can be created in a batch.

Response body

Response from chunks.batchCreate containing a list of created Chunks.

If successful, the response body contains data with the following structure:

JSON representation
{
  "chunks": [
    {
      object (Chunk)
    }
  ]
}
Fields
chunks[]

object (Chunk)

Chunks created.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/generative-language.retriever

For more information, see the Authentication Overview.

CreateChunkRequest

Request to create a Chunk.

JSON representation
{
  "parent": string,
  "chunk": {
    object (Chunk)
  }
}
Fields
parent

string

Required. The name of the Document where this Chunk will be created. Example: corpora/my-corpus-123/documents/the-doc-abc

chunk

object (Chunk)

Required. The Chunk to create.