Skip to main content

rechunkDocument

client.knowledge.rechunkDocument(documentId: string, data?: RechunkDocumentRequest): Promise<unknown>

Re-chunks a document using updated chunking settings.

Discards existing chunks and re-processes the document with the current or specified chunking strategy. Useful after changing collection settings or chunking parameters.

Parameters

ParameterTypeRequiredDescription
documentIdstringYesThe unique identifier of the document to re-chunk
dataRechunkDocumentRequestNoOptional parameters specifying the new chunking configuration

Returns

Promise<unknown> — A promise that resolves when re-chunking is complete

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.knowledge.rechunkDocument('documentId');
console.log(result);