sttp.openai.requests.batch

Members list

Type members

Classlikes

case class BatchRequestBody(inputFileId: String, endpoint: String, completionWindow: String, metadata: Option[Map[String, String]])

Value parameters

completionWindow

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

endpoint

The endpoint to be used for all requests in the batch. Currently, /v1/chat/completions, /v1/embeddings, and /v1/completions are supported. Note that /v1/embeddings batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.

inputFileId

The ID of an uploaded file that contains requests for the new batch. Your input file must be formatted as a JSONL file, and must be uploaded with the purpose batch. The file can contain up to 50,000 requests, and can be up to 200 MB in size.

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.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class BatchResponse(id: String, `object`: String, endpoint: String, errors: Option[Errors], inputFileId: String, completionWindow: String, status: String, outputFileId: Option[String], errorFileId: Option[String], createdAt: Int, inProgressAt: Option[Int], expiresAt: Option[Int], finalizingAt: Option[Int], completedAt: Option[Int], failedAt: Option[Int], expiredAt: Option[Int], cancellingAt: Option[Int], cancelledAt: Option[Int], requestCounts: Option[RequestCounts], metadata: Option[Map[String, String]])

Value parameters

`object`

The object type, which is always batch.

cancelledAt

The Unix timestamp (in seconds) for when the batch was cancelled.

cancellingAt

The Unix timestamp (in seconds) for when the batch started cancelling.

completedAt

The Unix timestamp (in seconds) for when the batch was completed.

completionWindow

The time frame within which the batch should be processed.

createdAt

The Unix timestamp (in seconds) for when the batch was created.

endpoint

The OpenAI API endpoint used by the batch.

errorFileId

The ID of the file containing the outputs of requests with errors.

errors

The errors object.

expiredAt

The Unix timestamp (in seconds) for when the batch expired.

expiresAt

The Unix timestamp (in seconds) for when the batch will expire.

failedAt

The Unix timestamp (in seconds) for when the batch failed.

finalizingAt

The Unix timestamp (in seconds) for when the batch started finalizing.

id

The ID of the batch.

inProgressAt

The Unix timestamp (in seconds) for when the batch started processing.

inputFileId

The ID of the input file for the 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.

outputFileId

The ID of the file containing the outputs of successfully executed requests.

requestCounts

The request counts for different statuses within the batch.

status

The current status of the batch.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object BatchResponse

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Data(code: String, message: String, param: Option[String], line: Option[Int])

Value parameters

code

An error code identifying the error type.

line

The line number of the input file where the error occurred, if applicable.

message

A human-readable message providing more details about the error.

param

The name of the parameter that caused the error, if applicable.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Data

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Data.type
case class Errors(`object`: String, data: Seq[Data])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Errors

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Errors.type
case class ListBatchResponse(`object`: String, data: Seq[BatchResponse], firstId: String, lastId: String, hasMore: Boolean)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class QueryParameters(after: Option[String], limit: Option[Int])

Value parameters

after

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RequestCounts(total: Int, completed: Int, failed: Int)

Value parameters

completed

Number of requests that have been completed successfully.

failed

Number of requests that have failed.

total

Total number of requests in the batch.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RequestCounts

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type