Class Batch
-
- All Implemented Interfaces:
public final class Batch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Batch.Builder
A builder for Batch.
public final class
Batch.Status
The current status of the batch.
public final class
Batch.Errors
public final class
Batch.Metadata
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
Method Summary
Modifier and Type Method Description final String
id()
final String
completionWindow()
The time frame within which the batch should be processed. final Long
createdAt()
The Unix timestamp (in seconds) for when the batch was created. final String
endpoint()
The OpenAI API endpoint used by the batch. final String
inputFileId()
The ID of the input file for the batch. final JsonValue
_object_()
The object type, which is always batch
.final Batch.Status
status()
The current status of the batch. final Optional<Long>
cancelledAt()
The Unix timestamp (in seconds) for when the batch was cancelled. final Optional<Long>
cancellingAt()
The Unix timestamp (in seconds) for when the batch started cancelling. final Optional<Long>
completedAt()
The Unix timestamp (in seconds) for when the batch was completed. final Optional<String>
errorFileId()
The ID of the file containing the outputs of requests with errors. final Optional<Batch.Errors>
errors()
final Optional<Long>
expiredAt()
The Unix timestamp (in seconds) for when the batch expired. final Optional<Long>
expiresAt()
The Unix timestamp (in seconds) for when the batch will expire. final Optional<Long>
failedAt()
The Unix timestamp (in seconds) for when the batch failed. final Optional<Long>
finalizingAt()
The Unix timestamp (in seconds) for when the batch started finalizing. final Optional<Long>
inProgressAt()
The Unix timestamp (in seconds) for when the batch started processing. final Optional<Batch.Metadata>
metadata()
Set of 16 key-value pairs that can be attached to an object. final Optional<String>
outputFileId()
The ID of the file containing the outputs of successfully executed requests. final Optional<BatchRequestCounts>
requestCounts()
The request counts for different statuses within the batch. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<String>
_completionWindow()
Returns the raw JSON value of completionWindow. final JsonField<Long>
_createdAt()
Returns the raw JSON value of createdAt. final JsonField<String>
_endpoint()
Returns the raw JSON value of endpoint. final JsonField<String>
_inputFileId()
Returns the raw JSON value of inputFileId. final JsonField<Batch.Status>
_status()
Returns the raw JSON value of status. final JsonField<Long>
_cancelledAt()
Returns the raw JSON value of cancelledAt. final JsonField<Long>
_cancellingAt()
Returns the raw JSON value of cancellingAt. final JsonField<Long>
_completedAt()
Returns the raw JSON value of completedAt. final JsonField<String>
_errorFileId()
Returns the raw JSON value of errorFileId. final JsonField<Batch.Errors>
_errors()
Returns the raw JSON value of errors. final JsonField<Long>
_expiredAt()
Returns the raw JSON value of expiredAt. final JsonField<Long>
_expiresAt()
Returns the raw JSON value of expiresAt. final JsonField<Long>
_failedAt()
Returns the raw JSON value of failedAt. final JsonField<Long>
_finalizingAt()
Returns the raw JSON value of finalizingAt. final JsonField<Long>
_inProgressAt()
Returns the raw JSON value of inProgressAt. final JsonField<Batch.Metadata>
_metadata()
Returns the raw JSON value of metadata. final JsonField<String>
_outputFileId()
Returns the raw JSON value of outputFileId. final JsonField<BatchRequestCounts>
_requestCounts()
Returns the raw JSON value of requestCounts. final Map<String, JsonValue>
_additionalProperties()
final Batch.Builder
toBuilder()
final Batch
validate()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Batch.Builder
builder()
Returns a mutable builder for constructing an instance of Batch. -
-
Method Detail
-
completionWindow
final String completionWindow()
The time frame within which the batch should be processed.
-
inputFileId
final String inputFileId()
The ID of the input file for the batch.
-
_object_
final JsonValue _object_()
The object type, which is always
batch
.Expected to always return the following:
JsonValue.from("batch")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
status
final Batch.Status status()
The current status of the batch.
-
cancelledAt
final Optional<Long> cancelledAt()
The Unix timestamp (in seconds) for when the batch was cancelled.
-
cancellingAt
final Optional<Long> cancellingAt()
The Unix timestamp (in seconds) for when the batch started cancelling.
-
completedAt
final Optional<Long> completedAt()
The Unix timestamp (in seconds) for when the batch was completed.
-
errorFileId
final Optional<String> errorFileId()
The ID of the file containing the outputs of requests with errors.
-
errors
final Optional<Batch.Errors> errors()
-
expiredAt
final Optional<Long> expiredAt()
The Unix timestamp (in seconds) for when the batch expired.
-
expiresAt
final Optional<Long> expiresAt()
The Unix timestamp (in seconds) for when the batch will expire.
-
finalizingAt
final Optional<Long> finalizingAt()
The Unix timestamp (in seconds) for when the batch started finalizing.
-
inProgressAt
final Optional<Long> inProgressAt()
The Unix timestamp (in seconds) for when the batch started processing.
-
metadata
final Optional<Batch.Metadata> metadata()
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
outputFileId
final Optional<String> outputFileId()
The ID of the file containing the outputs of successfully executed requests.
-
requestCounts
final Optional<BatchRequestCounts> requestCounts()
The request counts for different statuses within the batch.
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_completionWindow
final JsonField<String> _completionWindow()
Returns the raw JSON value of completionWindow.
Unlike completionWindow, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<Long> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_endpoint
final JsonField<String> _endpoint()
Returns the raw JSON value of endpoint.
Unlike endpoint, this method doesn't throw if the JSON field has an unexpected type.
-
_inputFileId
final JsonField<String> _inputFileId()
Returns the raw JSON value of inputFileId.
Unlike inputFileId, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<Batch.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_cancelledAt
final JsonField<Long> _cancelledAt()
Returns the raw JSON value of cancelledAt.
Unlike cancelledAt, this method doesn't throw if the JSON field has an unexpected type.
-
_cancellingAt
final JsonField<Long> _cancellingAt()
Returns the raw JSON value of cancellingAt.
Unlike cancellingAt, this method doesn't throw if the JSON field has an unexpected type.
-
_completedAt
final JsonField<Long> _completedAt()
Returns the raw JSON value of completedAt.
Unlike completedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_errorFileId
final JsonField<String> _errorFileId()
Returns the raw JSON value of errorFileId.
Unlike errorFileId, this method doesn't throw if the JSON field has an unexpected type.
-
_errors
final JsonField<Batch.Errors> _errors()
Returns the raw JSON value of errors.
Unlike errors, this method doesn't throw if the JSON field has an unexpected type.
-
_expiredAt
final JsonField<Long> _expiredAt()
Returns the raw JSON value of expiredAt.
Unlike expiredAt, this method doesn't throw if the JSON field has an unexpected type.
-
_expiresAt
final JsonField<Long> _expiresAt()
Returns the raw JSON value of expiresAt.
Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type.
-
_failedAt
final JsonField<Long> _failedAt()
Returns the raw JSON value of failedAt.
Unlike failedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_finalizingAt
final JsonField<Long> _finalizingAt()
Returns the raw JSON value of finalizingAt.
Unlike finalizingAt, this method doesn't throw if the JSON field has an unexpected type.
-
_inProgressAt
final JsonField<Long> _inProgressAt()
Returns the raw JSON value of inProgressAt.
Unlike inProgressAt, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<Batch.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_outputFileId
final JsonField<String> _outputFileId()
Returns the raw JSON value of outputFileId.
Unlike outputFileId, this method doesn't throw if the JSON field has an unexpected type.
-
_requestCounts
final JsonField<BatchRequestCounts> _requestCounts()
Returns the raw JSON value of requestCounts.
Unlike requestCounts, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Batch.Builder toBuilder()
-
builder
final static Batch.Builder builder()
Returns a mutable builder for constructing an instance of Batch.
The following fields are required:
.id() .completionWindow() .createdAt() .endpoint() .inputFileId() .status()
-
-
-
-