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 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 - the TaskStatusPollRequest containing the task identifier and optional wait time between polling attempts
      Returns:
      a TaskStatusPollResponse encapsulating the current status, position in the queue, and optional metadata for the specified task
      Throws:
      ValidationException - If request validation fails for any reason.
    • convertTaskResult

      ConvertDocumentResponse convertTaskResult(TaskResultRequest request)
      Returns the result of a completed convert task. 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 - the TaskResultRequest containing the unique task identifier for which the result is to be converted
      Returns:
      a ConvertDocumentResponse encapsulating the converted document, processing status, timings, and potential errors
      Throws:
      ValidationException - If request validation fails for any reason.
    • chunkTaskResult

      ChunkDocumentResponse chunkTaskResult(TaskResultRequest request)
      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 - the TaskResultRequest containing the unique identifier of the task whose result is to be processed and chunked
      Returns:
      a ChunkDocumentResponse containing the chunked result, associated documents, processing time, and additional relevant metadata
      Throws:
      ValidationException - If request validation fails for any reason.