Class: OpenAI::Models::FileObject

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/file_object.rb,
sig/openai/models/file_object.rbs

Overview

See Also:

  • OpenAI::Resources::Files#create

Defined Under Namespace

Modules: Purpose, Status

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

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(id:, bytes:, created_at:, filename:, purpose:, status:, expires_at: nil, status_details: nil, object: :file) ⇒ Object

Parameters:

  • id

    The file identifier, which can be referenced in the API endpoints.

  • bytes

    The size of the file, in bytes.

  • created_at

    The Unix timestamp (in seconds) for when the file was created.

  • filename

    The name of the file.

  • purpose

    The intended purpose of the file. Supported values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, vision, and user_data.

  • status

    Deprecated. The current status of the file, which can be either uploaded, processed, or error.

  • expires_at (defaults to: nil)

    The Unix timestamp (in seconds) for when the file will expire.

  • status_details (defaults to: nil)

    Deprecated. For details on why a fine-tuning training file failed validation, see the error field on fine_tuning.job.

  • object (defaults to: :file)

    The object type, which is always file.



# File 'lib/openai/models/file_object.rb', line 69

Instance Attribute Details

#bytesInteger

The size of the file, in bytes.

Returns:

  • (Integer)


17
# File 'lib/openai/models/file_object.rb', line 17

required :bytes, Integer

#created_atInteger

The Unix timestamp (in seconds) for when the file was created.

Returns:

  • (Integer)


23
# File 'lib/openai/models/file_object.rb', line 23

required :created_at, Integer

#expires_atInteger?

The Unix timestamp (in seconds) for when the file will expire.

Returns:

  • (Integer, nil)


58
# File 'lib/openai/models/file_object.rb', line 58

optional :expires_at, Integer

#filenameString

The name of the file.

Returns:

  • (String)


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

required :filename, String

#idString

The file identifier, which can be referenced in the API endpoints.

Returns:

  • (String)


11
# File 'lib/openai/models/file_object.rb', line 11

required :id, String

#object:file

The object type, which is always file.

Returns:

  • (:file)


35
# File 'lib/openai/models/file_object.rb', line 35

required :object, const: :file

#purposeOpenAI::Models::FileObject::purpose

The intended purpose of the file. Supported values are assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, vision, and user_data.

Returns:

  • (OpenAI::Models::FileObject::purpose)


43
# File 'lib/openai/models/file_object.rb', line 43

required :purpose, enum: -> { OpenAI::FileObject::Purpose }

#statusOpenAI::Models::FileObject::status

Deprecated. The current status of the file, which can be either uploaded, processed, or error.

Returns:

  • (OpenAI::Models::FileObject::status)


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

required :status, enum: -> { OpenAI::FileObject::Status }

#status_detailsString?

Deprecated. For details on why a fine-tuning training file failed validation, see the error field on fine_tuning.job.

Returns:

  • (String, nil)


67
# File 'lib/openai/models/file_object.rb', line 67

optional :status_details, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/file_object.rb', line 120

Instance Method Details

#to_hash{

Returns:

  • ({)


89
# File 'sig/openai/models/file_object.rbs', line 89

def to_hash: -> {