Class: OpenAI::Models::Containers::FileCreateParams

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

Overview

See Also:

  • OpenAI::Resources::Containers::Files#create

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

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(container_id:, file: nil, file_id: nil, request_options: {}) ⇒ FileCreateParams

Returns a new instance of FileCreateParams.

Parameters:

  • file (defaults to: nil) —

    The File object (not file name) to be uploaded.

    String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

  • file_id (defaults to: nil) —

    Name of the file to create.

  • container_id: (String)
  • file: (OpenAI::Internal::file_input) (defaults to: nil)
  • file_id: (String) (defaults to: nil)
  • request_options: (OpenAI::request_opts) (defaults to: {})


# File 'lib/openai/models/containers/file_create_params.rb', line 32

Instance Attribute Details

#container_id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


14
# File 'lib/openai/models/containers/file_create_params.rb', line 14

required :container_id, String

#file ⇒ OpenAI::Internal::file_input?

The File object (not file name) to be uploaded.

String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

Returns:

  • (OpenAI::Internal::file_input, nil)


24
# File 'lib/openai/models/containers/file_create_params.rb', line 24

optional :file, OpenAI::Internal::Type::FileInput

#file_id ⇒ String?

Name of the file to create.

Returns:

  • (String, nil)


30
# File 'lib/openai/models/containers/file_create_params.rb', line 30

optional :file_id, String

Instance Method Details

#to_hash ⇒ { container_id: String, ?file: OpenAI::Internal::file_input, ?file_id: String, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ container_id: String, ?file: OpenAI::Internal::file_input, ?file_id: String, ?request_options: OpenAI::RequestOptions })


55
56
57
58
59
60
# File 'sig/openai/models/containers/file_create_params.rbs', line 55

def to_hash: -> {
  container_id: String,
  ?file: OpenAI::Internal::file_input,
  ?file_id: String,
  ?request_options: OpenAI::RequestOptions
}