Class: OpenAI::Models::UploadCreateParams

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

Overview

See Also:

  • OpenAI::Resources::Uploads#create

Defined Under Namespace

Classes: ExpiresAfter

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_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 ⇒ Object

Parameters:

  • bytes —

    The number of bytes in the file you are uploading.

  • filename —

    The name of the file to upload.

  • mime_type —

    The MIME type of the file.

    This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.

  • purpose —

    The intended purpose of the uploaded file.

    See the documentation on File purposes.

  • expires_after —

    The expiration policy for a file. By default, files with purpose=batch expire after 30 days and all other files are persisted until they are manually deleted.



62
# File 'sig/openai/models/upload_create_params.rbs', line 62

def initialize: (

Instance Attribute Details

#bytes ⇒ Integer

The number of bytes in the file you are uploading.

Returns:

  • (Integer)


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

required :bytes, Integer

#expires_after ⇒ OpenAI::UploadCreateParams::ExpiresAfter?

The expiration policy for a file. By default, files with purpose=batch expire after 30 days and all other files are persisted until they are manually deleted.

Returns:

  • (OpenAI::UploadCreateParams::ExpiresAfter, nil)


45
# File 'lib/openai/models/upload_create_params.rb', line 45

optional :expires_after, -> { OpenAI::UploadCreateParams::ExpiresAfter }

#filename ⇒ String

The name of the file to upload.

Returns:

  • (String)


20
# File 'lib/openai/models/upload_create_params.rb', line 20

required :filename, String

#mime_type ⇒ String

The MIME type of the file.

This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.

Returns:

  • (String)


29
# File 'lib/openai/models/upload_create_params.rb', line 29

required :mime_type, String

#purpose ⇒ OpenAI::Models::file_purpose

The intended purpose of the uploaded file.

See the documentation on File purposes.

Returns:

  • (OpenAI::Models::file_purpose)


38
# File 'lib/openai/models/upload_create_params.rb', line 38

required :purpose, enum: -> { OpenAI::FilePurpose }

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


71
# File 'sig/openai/models/upload_create_params.rbs', line 71

def to_hash: -> {