Class: OpenAI::Models::BatchCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/batch_create_params.rb,
sig/openai/models/batch_create_params.rbs

Overview

See Also:

  • OpenAI::Resources::Batches#create

Defined Under Namespace

Modules: CompletionWindow, Endpoint Classes: OutputExpiresAfter

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(completion_window:, endpoint:, input_file_id:, metadata: nil, output_expires_after: nil, request_options: {}) ⇒ Object

Parameters:

  • completion_window —

    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/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits, and /v1/videos are supported. Note that /v1/embeddings batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.

  • input_file_id —

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

    See upload file for how to upload a file.

    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 (defaults to: nil) —

    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.

  • output_expires_after (defaults to: nil) —

    The expiration policy for the output and/or error file that are generated for a batch.



# File 'lib/openai/models/batch_create_params.rb', line 61

Instance Attribute Details

#completion_window ⇒ OpenAI::Models::BatchCreateParams::completion_window

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

Returns:

  • (OpenAI::Models::BatchCreateParams::completion_window)


15
# File 'lib/openai/models/batch_create_params.rb', line 15

required :completion_window, enum: -> { OpenAI::BatchCreateParams::CompletionWindow }

#endpoint ⇒ OpenAI::Models::BatchCreateParams::endpoint

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

Returns:

  • (OpenAI::Models::BatchCreateParams::endpoint)


26
# File 'lib/openai/models/batch_create_params.rb', line 26

required :endpoint, enum: -> { OpenAI::BatchCreateParams::Endpoint }

#input_file_id ⇒ String

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

See upload file for how to upload a file.

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.

Returns:

  • (String)


41
# File 'lib/openai/models/batch_create_params.rb', line 41

required :input_file_id, String

#metadata ⇒ OpenAI::Models::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.

Returns:

  • (OpenAI::Models::metadata, nil)


52
# File 'lib/openai/models/batch_create_params.rb', line 52

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#output_expires_after ⇒ OpenAI::BatchCreateParams::OutputExpiresAfter?

The expiration policy for the output and/or error file that are generated for a batch.

Returns:

  • (OpenAI::BatchCreateParams::OutputExpiresAfter, nil)


59
# File 'lib/openai/models/batch_create_params.rb', line 59

optional :output_expires_after, -> { OpenAI::BatchCreateParams::OutputExpiresAfter }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/batch_create_params.rb', line 107

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


99
# File 'sig/openai/models/batch_create_params.rbs', line 99

def to_hash: -> {