Class Batch

java.lang.Object
com.azure.ai.openai.models.Batch
All Implemented Interfaces:
com.azure.json.JsonSerializable<Batch>

public final class Batch extends Object implements com.azure.json.JsonSerializable<Batch>
The Batch object.
  • Method Details

    • getId

      public String getId()
      Get the id property: The id assigned to the Batch.
      Returns:
      the id value.
    • getObject

      public String getObject()
      Get the object property: The object type, which is always `batch`.
      Returns:
      the object value.
    • getEndpoint

      public String getEndpoint()
      Get the endpoint property: The OpenAI API endpoint used by the batch.
      Returns:
      the endpoint value.
    • getErrors

      public BatchErrorList getErrors()
      Get the errors property: The list of Batch errors.
      Returns:
      the errors value.
    • getInputFileId

      public String getInputFileId()
      Get the inputFileId property: The ID of the input file for the batch.
      Returns:
      the inputFileId value.
    • getCompletionWindow

      public String getCompletionWindow()
      Get the completionWindow property: The time frame within which the batch should be processed.
      Returns:
      the completionWindow value.
    • getStatus

      public BatchStatus getStatus()
      Get the status property: The current status of the batch.
      Returns:
      the status value.
    • getOutputFileId

      public String getOutputFileId()
      Get the outputFileId property: The ID of the file containing the outputs of successfully executed requests.
      Returns:
      the outputFileId value.
    • getErrorFileId

      public String getErrorFileId()
      Get the errorFileId property: The ID of the file containing the outputs of requests with errors.
      Returns:
      the errorFileId value.
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the createdAt property: The Unix timestamp (in seconds) for when the batch was created.
      Returns:
      the createdAt value.
    • getInProgressAt

      public OffsetDateTime getInProgressAt()
      Get the inProgressAt property: The Unix timestamp (in seconds) for when the batch started processing.
      Returns:
      the inProgressAt value.
    • getExpiresAt

      public OffsetDateTime getExpiresAt()
      Get the expiresAt property: The Unix timestamp (in seconds) for when the batch will expire.
      Returns:
      the expiresAt value.
    • getFinalizingAt

      public OffsetDateTime getFinalizingAt()
      Get the finalizingAt property: The Unix timestamp (in seconds) for when the batch started finalizing.
      Returns:
      the finalizingAt value.
    • getCompletedAt

      public OffsetDateTime getCompletedAt()
      Get the completedAt property: The Unix timestamp (in seconds) for when the batch was completed.
      Returns:
      the completedAt value.
    • getFailedAt

      public OffsetDateTime getFailedAt()
      Get the failedAt property: The Unix timestamp (in seconds) for when the batch failed.
      Returns:
      the failedAt value.
    • getExpiredAt

      public OffsetDateTime getExpiredAt()
      Get the expiredAt property: The Unix timestamp (in seconds) for when the batch expired.
      Returns:
      the expiredAt value.
    • getCancellingAt

      public OffsetDateTime getCancellingAt()
      Get the cancellingAt property: The Unix timestamp (in seconds) for when the batch started cancelling.
      Returns:
      the cancellingAt value.
    • getCancelledAt

      public OffsetDateTime getCancelledAt()
      Get the cancelledAt property: The Unix timestamp (in seconds) for when the batch was cancelled.
      Returns:
      the cancelledAt value.
    • getRequestCounts

      public BatchRequestCounts getRequestCounts()
      Get the requestCounts property: The request counts for different statuses within the batch.
      Returns:
      the requestCounts value.
    • getMetadata

      public Map<String,String> getMetadata()
      Get the metadata property: A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format.
      Returns:
      the metadata value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Batch>
      Throws:
      IOException
    • fromJson

      public static Batch fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Batch from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Batch if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the Batch.