Class TaskOperations

java.lang.Object
ai.docling.serve.client.operations.TaskOperations
All Implemented Interfaces:
ai.docling.serve.api.DoclingServeTaskApi

public final class TaskOperations extends Object implements ai.docling.serve.api.DoclingServeTaskApi
Base class for task API operations. Provides operations for managing and querying the status of asynchronous tasks.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.docling.serve.api.chunk.response.ChunkDocumentResponse
    chunkTaskResult(ai.docling.serve.api.task.request.TaskResultRequest request)
    Retrieves the chunked result of a completed task identified by the specified task ID.
    ai.docling.serve.api.convert.response.ConvertDocumentResponse
    convertTaskResult(ai.docling.serve.api.task.request.TaskResultRequest request)
    Retrieves the result of a completed convert task identified by the specified task ID.
    ai.docling.serve.api.task.response.TaskStatusPollResponse
    pollTaskStatus(ai.docling.serve.api.task.request.TaskStatusPollRequest request)
    Polls the current status of a specified task.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TaskOperations

      public TaskOperations(HttpOperations httpOperations)
  • Method Details

    • pollTaskStatus

      public ai.docling.serve.api.task.response.TaskStatusPollResponse pollTaskStatus(ai.docling.serve.api.task.request.TaskStatusPollRequest request)
      Polls the current status of a specified task. This method sends a GET request to the task status API endpoint to retrieve the current status of a task. The request includes the task ID and an optional wait time between polling attempts. The response contains details about the task's status, position in the queue, and any relevant metadata.
      Specified by:
      pollTaskStatus in interface ai.docling.serve.api.DoclingServeTaskApi
      Parameters:
      request - an instance of TaskStatusPollRequest containing the unique task identifier and optional wait time for polling. Must not be null.
      Returns:
      a TaskStatusPollResponse containing the current status of the task, its position in the queue, and any associated metadata.
      Throws:
      IllegalArgumentException - if the request is null.
    • convertTaskResult

      public ai.docling.serve.api.convert.response.ConvertDocumentResponse convertTaskResult(ai.docling.serve.api.task.request.TaskResultRequest request)
      Retrieves the result of a completed convert task identified by the specified task ID. This method sends a GET request to fetch the result of a task that has been processed.
      Specified by:
      convertTaskResult in interface ai.docling.serve.api.DoclingServeTaskApi
      Parameters:
      request - an instance of TaskResultRequest containing the unique task identifier. Must not be null.
      Returns:
      a ConvertDocumentResponse containing details about the converted document, processing time, status, and any associated errors or metadata.
      Throws:
      IllegalArgumentException - if request is null.
    • chunkTaskResult

      public ai.docling.serve.api.chunk.response.ChunkDocumentResponse chunkTaskResult(ai.docling.serve.api.task.request.TaskResultRequest request)
      Retrieves the chunked result of a completed task identified by the specified task ID. This method sends a GET request to fetch the chunked result of a task that has been processed. The response includes details about the chunks, associated documents, processing time, and any relevant metadata.
      Specified by:
      chunkTaskResult in interface ai.docling.serve.api.DoclingServeTaskApi
      Parameters:
      request - an instance of TaskResultRequest containing the unique task identifier. Must not be null.
      Returns:
      a ChunkDocumentResponse containing details about the chunks, documents, processing time, and any associated metadata.
      Throws:
      IllegalArgumentException - if request is null.