Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Batch(val id: BatchId, val endpoint: Endpoint, val errors: PaginatedList<OpenAIErrorDetails>?, val inputFileId: FileId? = null, val completionWindow: CompletionWindow? = null, val status: Status? = null, val outputFileId: FileId? = null, val errorFileId: FileId? = null, val createdAt: Long? = null, val inProgressAt: Long? = null, val expiresAt: Long? = null, val finalizingAt: Long? = null, val completedAt: Long? = null, val failedAt: Long? = null, val expiredAt: Long? = null, val cancellingAt: Long? = null, val cancelledAt: Long? = null, val requestCounts: RequestCounts? = null, val metadata: Map<String, String>? = null)

Represents a batch object.

Link copied to clipboard
@Serializable
value class BatchId(val id: String)

The batch identifier.

Link copied to clipboard
@Serializable
data class BatchRequest(val inputFileId: FileId, val endpoint: Endpoint, val completionWindow: CompletionWindow, val metadata: Map<String, String>? = null)

Creates and executes a batch from an uploaded file of requests

Link copied to clipboard
Link copied to clipboard
@Serializable
value class CompletionWindow(val value: String)

The batch identifier.

Link copied to clipboard
@Serializable
value class CustomId(val value: String)

Custom ID for the request.

Link copied to clipboard
@Serializable
value class Method(val value: String)

HTTP Method.

Link copied to clipboard
@Serializable
data class RequestCounts(val total: Int, val completed: Int, val failed: Int)

The request counts for different statuses within the batch.

Link copied to clipboard
@Serializable
data class RequestInput(val customId: CustomId, val method: Method, val url: String, val body: ChatCompletionRequest? = null)

The per-line object of the batch input file.

Link copied to clipboard
@Serializable
data class RequestOutput(val id: BatchId, val customId: CustomId, val response: ResponseOutput? = null, val error: OpenAIErrorDetails? = null)

The per-line object of the batch input file.

Link copied to clipboard
@Serializable
data class ResponseOutput(val statusCode: Int, val requestId: RequestId, val body: JsonObject)

The response output of the API request.

Functions

Link copied to clipboard