Class: OpenAI::Models::Upload

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/upload.rb

Overview

Defined Under Namespace

Modules: Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, 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: , expires_at: , filename: , purpose: , status: , file: nil, object: :upload) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Upload for more details.

The Upload object can accept byte chunks in the form of Parts.

Parameters:

  • id (String) (defaults to: )

    The Upload unique identifier, which can be referenced in API endpoints.

  • bytes (Integer) (defaults to: )

    The intended number of bytes to be uploaded.

  • created_at (Integer) (defaults to: )

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

  • expires_at (Integer) (defaults to: )

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

  • filename (String) (defaults to: )

    The name of the file to be uploaded.

  • purpose (String) (defaults to: )

    The intended purpose of the file. [Please refer here](platform.openai.co

  • status (Symbol, OpenAI::Models::Upload::Status) (defaults to: )

    The status of the Upload.

  • file (OpenAI::Models::FileObject, nil) (defaults to: nil)

    The ‘File` object represents a document that has been uploaded to OpenAI.

  • object (Symbol, :upload) (defaults to: :upload)

    The object type, which is always “upload”.



# File 'lib/openai/models/upload.rb', line 63

Instance Attribute Details

#bytesInteger

The intended number of bytes to be uploaded.

Returns:

  • (Integer)


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

required :bytes, Integer

#created_atInteger

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

Returns:

  • (Integer)


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

required :created_at, Integer

#expires_atInteger

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

Returns:

  • (Integer)


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

required :expires_at, Integer

#fileOpenAI::Models::FileObject?

The ‘File` object represents a document that has been uploaded to OpenAI.

Returns:



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

optional :file, -> { OpenAI::FileObject }, nil?: true

#filenameString

The name of the file to be uploaded.

Returns:

  • (String)


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

required :filename, String

#idString

The Upload unique identifier, which can be referenced in API endpoints.

Returns:

  • (String)


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

required :id, String

#objectSymbol, :upload

The object type, which is always “upload”.

Returns:

  • (Symbol, :upload)


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

required :object, const: :upload

#purposeString

The intended purpose of the file. [Please refer here](platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values.

Returns:

  • (String)


49
# File 'lib/openai/models/upload.rb', line 49

required :purpose, String

#statusSymbol, OpenAI::Models::Upload::Status

The status of the Upload.

Returns:



55
# File 'lib/openai/models/upload.rb', line 55

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