Class: OpenAI::Models::VectorStores::VectorStoreFile

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

Overview

See Also:

  • OpenAI::Resources::VectorStores::Files#create

Defined Under Namespace

Modules: Attribute, Status Classes: LastError

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:, created_at:, last_error:, status:, usage_bytes:, vector_store_id:, attributes: nil, chunking_strategy: nil, object: :"vector_store.file") ⇒ Object

Parameters:

  • id —

    The identifier, which can be referenced in API endpoints.

  • created_at —

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

  • last_error —

    The last error associated with this vector store file. Will be null if there are no errors.

  • status —

    The status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.

  • usage_bytes —

    The total vector store usage in bytes. Note that this may be different from the original file size.

  • vector_store_id —

    The ID of the vector store that the File is attached to.

  • attributes (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, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.

  • chunking_strategy (defaults to: nil) —

    The strategy used to chunk the file.

  • object (defaults to: :"vector_store.file") —

    The object type, which is always vector_store.file.



# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 79

Instance Attribute Details

#attributes ⇒ ::Hash[Symbol, OpenAI::Models::VectorStores::VectorStoreFile::attribute]?

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, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.

Returns:

  • (::Hash[Symbol, OpenAI::Models::VectorStores::VectorStoreFile::attribute], nil)


65
66
67
68
69
70
71
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 65

optional(
  :attributes,
  -> {
    OpenAI::Internal::Type::HashOf[union: OpenAI::VectorStores::VectorStoreFile::Attribute]
  },
  nil?: true
)

#chunking_strategy ⇒ OpenAI::Models::file_chunking_strategy?

The strategy used to chunk the file.

Returns:

  • (OpenAI::Models::file_chunking_strategy, nil)


77
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 77

optional :chunking_strategy, union: -> { OpenAI::FileChunkingStrategy }

#created_at ⇒ Integer

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

Returns:

  • (Integer)


18
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 18

required :created_at, Integer

#id ⇒ String

The identifier, which can be referenced in API endpoints.

Returns:

  • (String)


12
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 12

required :id, String

#last_error ⇒ OpenAI::VectorStores::VectorStoreFile::LastError?

The last error associated with this vector store file. Will be null if there are no errors.

Returns:

  • (OpenAI::VectorStores::VectorStoreFile::LastError, nil)


25
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 25

required :last_error, -> { OpenAI::VectorStores::VectorStoreFile::LastError }, nil?: true

#object ⇒ :"vector_store.file"

The object type, which is always vector_store.file.

Returns:

  • (:"vector_store.file")


31
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 31

required :object, const: :"vector_store.file"

#status ⇒ OpenAI::Models::VectorStores::VectorStoreFile::status

The status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.

Returns:

  • (OpenAI::Models::VectorStores::VectorStoreFile::status)


39
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 39

required :status, enum: -> { OpenAI::VectorStores::VectorStoreFile::Status }

#usage_bytes ⇒ Integer

The total vector store usage in bytes. Note that this may be different from the original file size.

Returns:

  • (Integer)


46
# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 46

required :usage_bytes, Integer

#vector_store_id ⇒ String

The ID of the vector store that the File is attached to.

Returns:

  • (String)


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

required :vector_store_id, String

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/vector_stores/vector_store_file.rb', line 154

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


104
# File 'sig/openai/models/vector_stores/vector_store_file.rbs', line 104

def to_hash: -> {