Class BatchClient

java.lang.Object
io.github.stefanbratanov.jvm.openai.BatchClient

public final class BatchClient extends Object
Create large batches of API requests to run asynchronously.

Based on Batch

  • Method Details

    • createBatch

      public Batch createBatch(CreateBatchRequest request)
      Creates and executes a batch from an uploaded file of requests
      Throws:
      OpenAIException - in case of API errors
    • retrieveBatch

      public Batch retrieveBatch(String batchId)
      Retrieves a batch
      Throws:
      OpenAIException - in case of API errors
    • cancelBatch

      public Batch cancelBatch(String batchId)
      Cancels an in-progress batch
      Returns:
      The Batch object matching the specified ID.
      Throws:
      OpenAIException - in case of API errors
    • listBatches

      public BatchClient.PaginatedBatches listBatches(Optional<String> after, Optional<Integer> limit)
      List your organization's batches
      Parameters:
      after - A cursor for use in pagination. after is an object ID that defines your place in the list.
      limit - A limit on the number of objects to be returned.
      Throws:
      OpenAIException - in case of API errors