View Source OpenAi.Batch (OpenAI REST API Client v1.0.1)
Provides API endpoints related to batch
Summary
Functions
Cancels an in-progress batch. The batch will be in status cancelling for up to 10 minutes, before changing to cancelled, where it will have partial results (if any) available in the output file.
Creates and executes a batch from an uploaded file of requests
List your organization's batches.
Retrieves a batch.
Types
@type t() :: %OpenAi.Batch{ cancelled_at: integer() | nil, cancelling_at: integer() | nil, completed_at: integer() | nil, completion_window: String.t(), created_at: integer(), endpoint: String.t(), error_file_id: String.t() | nil, errors: OpenAi.Batch.Errors.t() | nil, expired_at: integer() | nil, expires_at: integer() | nil, failed_at: integer() | nil, finalizing_at: integer() | nil, id: String.t(), in_progress_at: integer() | nil, input_file_id: String.t(), metadata: map() | nil, object: String.t(), output_file_id: String.t() | nil, request_counts: OpenAi.Batch.RequestCounts.t() | nil, status: String.t() }
Functions
@spec cancel_batch(batch_id :: String.t(), opts :: keyword()) :: {:ok, t()} | {:error, OpenAi.Error.error()}
Cancels an in-progress batch. The batch will be in status cancelling for up to 10 minutes, before changing to cancelled, where it will have partial results (if any) available in the output file.
@spec create_batch(body :: map(), opts :: keyword()) :: {:ok, t()} | {:error, OpenAi.Error.error()}
Creates and executes a batch from an uploaded file of requests
@spec list_batches(opts :: keyword()) :: {:ok, OpenAi.Batch.ListResponse.t()} | {:error, OpenAi.Error.error()}
List your organization's batches.
Options
after: A cursor for use in pagination.afteris 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.
@spec retrieve_batch(batch_id :: String.t(), opts :: keyword()) :: {:ok, t()} | {:error, OpenAi.Error.error()}
Retrieves a batch.