v1

latestOpenAPI 3.0.22026-07-173834119.9 KB
Chunking

Create Chunking Job

Endpoint to Create a Chunking Job

This endpoint creates a chunking job and returns the job ID that can be used to get the status of the job.


Request Body

FieldTypeDescription
extraction_job_idstrThe ID of the extraction job.
chunking_strategystrThe chunking strategy to use.
chunking_paramsOptional[ChunkingParams]Optional parameters for the chunking strategy.

Chunking Strategies

  • fixed_size: Chunks the file into fixed-size segments.
  • recursive: Recursively splits the file into smaller segments based on a delimiter.

Chunking Parameters

FieldTypeDescription
chunk_sizeintThe size of each chunk in character.
chunk_overlapintThe number of overlapping characters between chunks.

Example Request Body


{
    "extraction_job_id": "123456",
    "chunking_strategy": "fixed_size",
    "chunking_params": {
        "chunk_size": 1000,
        "chunk_overlap": 100
    }
}


Response Body

FieldTypeDescription
chunking_job_idstrThe ID of the created job.
extraction_job_idstrThe ID of the extraction job.
statusstrThe status of the created job. Returns WAITING_QUEUE_ALLOCATION if the job is created successfully.
total_file_countintThe total number of files to be chunked.

Errors

  • 400 Bad Request: If a chunking job with status 'WAITING_QUEUE_ALLOCATION' already exists.
  • 400 Bad Request: If the extraction job is not in COMPLETED or COMPLETED_WITH_ERRORS state.
  • 500 Internal Server Error: If there is an unexpected error during the creation of the chunking job.
post/document/chunking/create_job

Request body

extraction_job_idstring required
chunking_strategy'fixed_size' | 'recursive' | 'page' required

Response

Successful Response

chunking_job_idstring required
extraction_job_idstring required
statusstring required
total_file_countinteger required