BatchRequest

@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

Constructors

Link copied to clipboard
constructor(inputFileId: FileId, endpoint: Endpoint, completionWindow: CompletionWindow, metadata: Map<String, String>? = null)

Properties

Link copied to clipboard
@SerialName(value = "completion_window")
val completionWindow: CompletionWindow

The time frame within which the batch should be processed. Currently only 24h is supported.

Link copied to clipboard
@SerialName(value = "endpoint")
val endpoint: Endpoint

The endpoint to be used for all requests in the batch. Currently only Endpoint.Completions is supported.

Link copied to clipboard
@SerialName(value = "input_file_id")
val inputFileId: FileId

The ID of an uploaded file that contains requests for the new batch.

Link copied to clipboard
@SerialName(value = "metadata")
val metadata: Map<String, String>? = null

Optional custom metadata for the batch.