Package ai.docling.serve.api
Interface DoclingServeChunkApi
- All Known Subinterfaces:
DoclingServeApi
public interface DoclingServeChunkApi
Represents the Docling Serve Chunk API, providing methods for processing document sources
by splitting them into smaller chunks using various chunking strategies. This interface
ensures flexibility by supporting both hierarchical and hybrid chunking mechanisms.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ChunkDocumentResponsechunkFilesWithHierarchicalChunker(@Nullable HierarchicalChunkDocumentRequest request, Path... files) Processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker.default ChunkDocumentResponsechunkFilesWithHierarchicalChunker(Path... files) Processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker.default CompletionStage<ChunkDocumentResponse>chunkFilesWithHierarchicalChunkerAsync(@Nullable HierarchicalChunkDocumentRequest request, Path... files) Asynchronously processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker.default CompletionStage<ChunkDocumentResponse>chunkFilesWithHierarchicalChunkerAsync(Path... files) Asynchronously processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker.default ChunkDocumentResponsechunkFilesWithHybridChunker(@Nullable HybridChunkDocumentRequest request, Path... files) Processes and chunks the specified files into smaller, structured pieces using a hybrid chunking strategy.default ChunkDocumentResponsechunkFilesWithHybridChunker(Path... files) Processes and chunks the specified files into smaller, structured pieces using a hybrid chunking strategy.default CompletionStage<ChunkDocumentResponse>chunkFilesWithHybridChunkerAsync(@Nullable HybridChunkDocumentRequest request, Path... files) Asynchronously processes and chunks the given files using a hybrid chunking mechanism.default CompletionStage<ChunkDocumentResponse>chunkFilesWithHybridChunkerAsync(Path... files) Asynchronously processes and chunks the provided files using a hybrid chunking strategy.Converts and chunks the provided document source(s) into a processed document based on the specified options and using a hierarchical chunker for splitting the document into smaller chunks.Asynchronously processes the provided document source(s) by converting and chunking them into smaller documents using the hierarchical chunker.Processes and chunks the provided document source(s) into smaller documents using a hybrid chunking strategy.Asynchronously processes the provided document source(s) by converting and chunking them into smaller documents using the hybrid chunker.
-
Method Details
-
chunkSourceWithHierarchicalChunker
Converts and chunks the provided document source(s) into a processed document based on the specified options and using a hierarchical chunker for splitting the document into smaller chunks.- Parameters:
request- the request containing the document source(s) and options for hierarchical chunking- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted document, - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHierarchicalChunker
Processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker. This method internally delegates the processing to another overloaded method with default options for the hierarchical chunker.- Parameters:
files- the files to be processed and chunked using the hierarchical chunker- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted documents, and associated metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHierarchicalChunker
default ChunkDocumentResponse chunkFilesWithHierarchicalChunker(@Nullable HierarchicalChunkDocumentRequest request, Path... files) Processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker. This method utilizes a provided hierarchical chunk request, applying additional configurations if needed during the creation of the chunking request.- Parameters:
request- the request containing configurations and options for hierarchical chunking. It may include settings for conversion, chunking parameters, and optional output specifications. Can be null to use default options.files- the files to be processed and chunked using the hierarchical chunker.- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted documents, and associated metadata. - Throws:
ValidationException- If request validation fails for any reason.
-
chunkSourceWithHybridChunker
Processes and chunks the provided document source(s) into smaller documents using a hybrid chunking strategy. The method utilizes the specified hybrid chunker options to split and process the input request.- Parameters:
request- the request containing the document source(s), conversion options, hybrid chunker configurations, and optional specifications for output targets- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted document, and other relevant metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHybridChunker
Processes and chunks the specified files into smaller, structured pieces using a hybrid chunking strategy. This method delegates the processing to another overloaded method with default options for the hybrid chunker.- Parameters:
files- the files to be processed and chunked using the hybrid chunker- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted documents, and associated metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHybridChunker
default ChunkDocumentResponse chunkFilesWithHybridChunker(@Nullable HybridChunkDocumentRequest request, Path... files) Processes and chunks the specified files into smaller, structured pieces using a hybrid chunking strategy. The method converts the input files into a hybrid chunk request and processes them to generate a structured representation of the content.- Parameters:
request- the request containing configurations for processing, including conversion options, hybrid chunking parameters, and optional specifications for output targets. Can be null to use default options.files- the files to be processed and chunked using the hybrid chunking strategy.- Returns:
- a
ChunkDocumentResponsecontaining the processed chunks, optionally the converted documents, and associated metadata. - Throws:
ValidationException- If request validation fails for any reason.
-
chunkSourceWithHierarchicalChunkerAsync
CompletionStage<ChunkDocumentResponse> chunkSourceWithHierarchicalChunkerAsync(HierarchicalChunkDocumentRequest request) Asynchronously processes the provided document source(s) by converting and chunking them into smaller documents using the hierarchical chunker. This operation allows for handling large document processing tasks without blocking the caller thread.- Parameters:
request- the request containing the document source(s) and options for hierarchical chunking- Returns:
- a
CompletionStagethat resolves to aChunkDocumentResponse, which contains the processed chunks, optionally the converted document, and processing metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHierarchicalChunkerAsync
default CompletionStage<ChunkDocumentResponse> chunkFilesWithHierarchicalChunkerAsync(Path... files) Asynchronously processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker. This method delegates the processing to another overloaded method with default options for the hierarchical chunker, leveraging non-blocking asynchronous execution.- Parameters:
files- the files to be processed and chunked using the hierarchical chunker- Returns:
- a
CompletionStageresolving to aChunkDocumentResponse, which includes the processed chunks, optionally the converted documents, and associated metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHierarchicalChunkerAsync
default CompletionStage<ChunkDocumentResponse> chunkFilesWithHierarchicalChunkerAsync(@Nullable HierarchicalChunkDocumentRequest request, Path... files) Asynchronously processes and chunks the specified files into smaller, structured pieces using a hierarchical chunker. This method allows for non-blocking execution by delegating the processing to an underlying method that handles hierarchical chunking configurations and file chunking.- Parameters:
request- the request object containing configurations, options for hierarchical chunking, and optional specifications for output targets. Can be null to use default options for processing.files- the files to be processed and chunked using the hierarchical chunker.- Returns:
- a
CompletionStagethat resolves to aChunkDocumentResponse, which includes the processed chunks, optionally the converted documents, and associated metadata. - Throws:
ValidationException- If request validation fails for any reason.
-
chunkSourceWithHybridChunkerAsync
CompletionStage<ChunkDocumentResponse> chunkSourceWithHybridChunkerAsync(HybridChunkDocumentRequest request) Asynchronously processes the provided document source(s) by converting and chunking them into smaller documents using the hybrid chunker. This operation facilitates non-blocking processing of large document tasks by leveraging a hybrid chunking strategy.- Parameters:
request- the request containing the document source(s), options for conversion, hybrid chunking parameters, and optional specifications for output targets- Returns:
- a
CompletionStagethat resolves to aChunkDocumentResponse, which includes the processed chunks, optionally the converted document, and relevant processing metadata - Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHybridChunkerAsync
Asynchronously processes and chunks the provided files using a hybrid chunking strategy.- Parameters:
files- An array of file paths to be processed and chunked. Each path should represent a valid file location.- Returns:
- A CompletionStage that, when completed, holds a ChunkDocumentResponse containing the results of the chunking operation.
- Throws:
ValidationException- If request validation fails for any reason.
-
chunkFilesWithHybridChunkerAsync
default CompletionStage<ChunkDocumentResponse> chunkFilesWithHybridChunkerAsync(@Nullable HybridChunkDocumentRequest request, Path... files) Asynchronously processes and chunks the given files using a hybrid chunking mechanism.- Parameters:
request- An optionalHybridChunkDocumentRequestcontaining configuration details for chunking. Ifnull, default settings will be applied.files- A varargs array ofPathobjects representing the files to be chunked. Must not be null or empty.- Returns:
- A
CompletionStage<ChunkDocumentResponse>that completes with the resultingChunkDocumentResponseonce the chunking operation is finished. - Throws:
ValidationException- If request validation fails for any reason.
-