Batch Class

  • java.lang.Object
    • com.azure.ai.openai.models.Batch

Implements

public final class Batch
implements JsonSerializable<Batch>

The Batch object.

Method Summary

Modifier and Type Method and Description
static Batch fromJson(JsonReader jsonReader)

Reads an instance of Batch from the JsonReader.

OffsetDateTime getCancelledAt()

Get the cancelledAt property: The Unix timestamp (in seconds) for when the batch was cancelled.

OffsetDateTime getCancellingAt()

Get the cancellingAt property: The Unix timestamp (in seconds) for when the batch started cancelling.

OffsetDateTime getCompletedAt()

Get the completedAt property: The Unix timestamp (in seconds) for when the batch was completed.

String getCompletionWindow()

Get the completionWindow property: The time frame within which the batch should be processed.

OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) for when the batch was created.

String getEndpoint()

Get the endpoint property: The OpenAI API endpoint used by the batch.

String getErrorFileId()

Get the errorFileId property: The ID of the file containing the outputs of requests with errors.

BatchErrorList getErrors()

Get the errors property: The list of Batch errors.

OffsetDateTime getExpiredAt()

Get the expiredAt property: The Unix timestamp (in seconds) for when the batch expired.

OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) for when the batch will expire.

OffsetDateTime getFailedAt()

Get the failedAt property: The Unix timestamp (in seconds) for when the batch failed.

OffsetDateTime getFinalizingAt()

Get the finalizingAt property: The Unix timestamp (in seconds) for when the batch started finalizing.

String getId()

Get the id property: The id assigned to the Batch.

OffsetDateTime getInProgressAt()

Get the inProgressAt property: The Unix timestamp (in seconds) for when the batch started processing.

String getInputFileId()

Get the inputFileId property: The ID of the input file for the batch.

Map<String,String> getMetadata()

Get the metadata property: A set of key-value pairs that can be attached to the batch.

String getObject()

Get the object property: The object type, which is always `batch`.

String getOutputFileId()

Get the outputFileId property: The ID of the file containing the outputs of successfully executed requests.

BatchRequestCounts getRequestCounts()

Get the requestCounts property: The request counts for different statuses within the batch.

BatchStatus getStatus()

Get the status property: The current status of the batch.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static Batch fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

getCancelledAt

public OffsetDateTime getCancelledAt()

Get the cancelledAt property: The Unix timestamp (in seconds) for when the batch was cancelled.

Returns:

the cancelledAt value.

getCancellingAt

public OffsetDateTime getCancellingAt()

Get the cancellingAt property: The Unix timestamp (in seconds) for when the batch started cancelling.

Returns:

the cancellingAt value.

getCompletedAt

public OffsetDateTime getCompletedAt()

Get the completedAt property: The Unix timestamp (in seconds) for when the batch was completed.

Returns:

the completedAt value.

getCompletionWindow

public String getCompletionWindow()

Get the completionWindow property: The time frame within which the batch should be processed.

Returns:

the completionWindow value.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) for when the batch was created.

Returns:

the createdAt value.

getEndpoint

public String getEndpoint()

Get the endpoint property: The OpenAI API endpoint used by the batch.

Returns:

the endpoint 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.

getErrors

public BatchErrorList getErrors()

Get the errors property: The list of Batch errors.

Returns:

the errors value.

getExpiredAt

public OffsetDateTime getExpiredAt()

Get the expiredAt property: The Unix timestamp (in seconds) for when the batch expired.

Returns:

the expiredAt value.

getExpiresAt

public OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) for when the batch will expire.

Returns:

the expiresAt value.

getFailedAt

public OffsetDateTime getFailedAt()

Get the failedAt property: The Unix timestamp (in seconds) for when the batch failed.

Returns:

the failedAt value.

getFinalizingAt

public OffsetDateTime getFinalizingAt()

Get the finalizingAt property: The Unix timestamp (in seconds) for when the batch started finalizing.

Returns:

the finalizingAt value.

getId

public String getId()

Get the id property: The id assigned to the Batch.

Returns:

the id value.

getInProgressAt

public OffsetDateTime getInProgressAt()

Get the inProgressAt property: The Unix timestamp (in seconds) for when the batch started processing.

Returns:

the inProgressAt value.

getInputFileId

public String getInputFileId()

Get the inputFileId property: The ID of the input file for the batch.

Returns:

the inputFileId value.

getMetadata

public Map 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.

getObject

public String getObject()

Get the object property: The object type, which is always `batch`.

Returns:

the object 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.

getRequestCounts

public BatchRequestCounts getRequestCounts()

Get the requestCounts property: The request counts for different statuses within the batch.

Returns:

the requestCounts value.

getStatus

public BatchStatus getStatus()

Get the status property: The current status of the batch.

Returns:

the status value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to