Package ai.docling.serve.api
Interface DoclingServeTaskApi
- All Known Subinterfaces:
DoclingServeApi
public interface DoclingServeTaskApi
Defines the interface for the Docling Task API, which provides operations for
managing and querying the status of asynchronous tasks.
This interface supports task status polling with configurable wait durations
and a default polling mechanism. It serves as the base for specific implementations
such as
DoclingServeApi.-
Method Summary
Modifier and TypeMethodDescriptionchunkTaskResult(TaskResultRequest request) Processes the result of a completed task and splits it into smaller chunks as per the provided request specifications.convertTaskResult(TaskResultRequest request) Converts the result of a completed task into a document format as specified in the request.pollTaskStatus(TaskStatusPollRequest request) Polls the status of an asynchronous task based on the provided request.
-
Method Details
-
pollTaskStatus
Polls the status of an asynchronous task based on the provided request. This method retrieves the current status of a task using the task identifier specified in the request object. It allows monitoring of a task's progress, position in the queue, and detailed status metadata, if available. The polling behavior can be influenced by optional configurations such as the wait time between polling attempts provided in the request.- Parameters:
request- theTaskStatusPollRequestcontaining the task identifier and optional wait time between polling attempts- Returns:
- a
TaskStatusPollResponseencapsulating the current status, position in the queue, and optional metadata for the specified task
-
convertTaskResult
Converts the result of a completed task into a document format as specified in the request. This method processes the task result identified by the unique task ID provided in the request, performs any necessary transformation, and returns a response containing the converted document and related details.- Parameters:
request- theTaskResultRequestcontaining the unique task identifier for which the result is to be converted- Returns:
- a
ConvertDocumentResponseencapsulating the converted document, processing status, timings, and potential errors
-
chunkTaskResult
Processes the result of a completed task and splits it into smaller chunks as per the provided request specifications. The method uses the unique task identifier, provided in the request, to locate the task result. It then analyzes the result and breaks it into chunks, which are included in the response along with any relevant metadata.- Parameters:
request- theTaskResultRequestcontaining the unique identifier of the task whose result is to be processed and chunked- Returns:
- a
ChunkDocumentResponsecontaining the chunked result, associated documents, processing time, and additional relevant metadata
-