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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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: {}) ⇒ BatchCreateParams

Returns a new instance of BatchCreateParams.

Parameters:

  • completion_window —

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

  • endpoint —

    The endpoint for all requests in the batch. Batches using /v1/embeddings can contain at most 50,000 embedding inputs across all requests.

  • 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.

    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.

  • completion_window: (OpenAI::Models::BatchCreateParams::completion_window)
  • endpoint: (OpenAI::Models::BatchCreateParams::endpoint)
  • input_file_id: (String)
  • metadata: (OpenAI::Models::metadata, nil) (defaults to: nil)
  • output_expires_after: (OpenAI::BatchCreateParams::OutputExpiresAfter) (defaults to: nil)
  • request_options: (OpenAI::request_opts) (defaults to: {})


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

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 for all requests in the batch. Batches using /v1/embeddings can contain at most 50,000 embedding inputs across all requests.

Returns:

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


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

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)


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

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.

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)


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

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)


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

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 97

Instance Method Details

#to_hash ⇒ { completion_window: OpenAI::Models::BatchCreateParams::completion_window, endpoint: OpenAI::Models::BatchCreateParams::endpoint, input_file_id: String, ?metadata: OpenAI::Models::metadata?, ?output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ completion_window: OpenAI::Models::BatchCreateParams::completion_window, endpoint: OpenAI::Models::BatchCreateParams::endpoint, input_file_id: String, ?metadata: OpenAI::Models::metadata?, ?output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter, ?request_options: OpenAI::RequestOptions })


89
90
91
92
93
94
95
96
# File 'sig/openai/models/batch_create_params.rbs', line 89

def to_hash: -> {
  completion_window: OpenAI::Models::BatchCreateParams::completion_window,
  endpoint: OpenAI::Models::BatchCreateParams::endpoint,
  input_file_id: String,
  ?metadata: OpenAI::Models::metadata?,
  ?output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter,
  ?request_options: OpenAI::RequestOptions
}