Class: OpenAI::Models::VectorStore

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

Overview

See Also:

  • OpenAI::Resources::VectorStores#create

Defined Under Namespace

Modules: Status Classes: ExpiresAfter, FileCounts

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_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(cancelled:, completed:, failed:, in_progress:, total:) ⇒ VectorStore

Returns a new instance of VectorStore.

Parameters:

  • id —

    The identifier, which can be referenced in API endpoints.

  • created_at —

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

  • last_active_at —

    The Unix timestamp (in seconds) for when the vector store was last active.

  • metadata —

    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.

    Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

  • name —

    The name of the vector store.

  • status —

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

  • usage_bytes —

    The total number of bytes used by the files in the vector store.

  • expires_after —

    The expiration policy for a vector store.

  • expires_at —

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

  • object —

    The object type, which is always vector_store.

  • id: (String)
  • created_at: (Integer)
  • file_counts: (OpenAI::VectorStore::FileCounts)
  • last_active_at: (Integer, nil)
  • metadata: (OpenAI::Models::metadata, nil)
  • name: (String)
  • status: (OpenAI::Models::VectorStore::status)
  • usage_bytes: (Integer)
  • expires_after: (OpenAI::VectorStore::ExpiresAfter)
  • expires_at: (Integer, nil)
  • object: (:vector_store)


# File 'lib/openai/models/vector_store.rb', line 78

Instance Attribute Details

#created_at ⇒ Integer

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

Returns:

  • (Integer)


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

required :created_at, Integer

#expires_after ⇒ OpenAI::VectorStore::ExpiresAfter?

The expiration policy for a vector store.

Returns:

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


70
# File 'lib/openai/models/vector_store.rb', line 70

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

#expires_at ⇒ Integer?

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

Returns:

  • (Integer, nil)


76
# File 'lib/openai/models/vector_store.rb', line 76

optional :expires_at, Integer, nil?: true

#file_counts ⇒ OpenAI::Models::VectorStore::FileCounts

Parameters:

  • value (OpenAI::VectorStore::FileCounts)

Returns:



22
# File 'lib/openai/models/vector_store.rb', line 22

required :file_counts, -> { OpenAI::VectorStore::FileCounts }

#id ⇒ String

The identifier, which can be referenced in API endpoints.

Returns:

  • (String)


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

required :id, String

#last_active_at ⇒ Integer?

The Unix timestamp (in seconds) for when the vector store was last active.

Returns:

  • (Integer, nil)


28
# File 'lib/openai/models/vector_store.rb', line 28

required :last_active_at, Integer, nil?: true

#metadata ⇒ OpenAI::Models::metadata?

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.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

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


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

required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#name ⇒ String

The name of the vector store.

Returns:

  • (String)


44
# File 'lib/openai/models/vector_store.rb', line 44

required :name, String

#object ⇒ :vector_store

The object type, which is always vector_store.

Returns:

  • (:vector_store)


50
# File 'lib/openai/models/vector_store.rb', line 50

required :object, const: :vector_store

#status ⇒ OpenAI::Models::VectorStore::status

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

Returns:

  • (OpenAI::Models::VectorStore::status)


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

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

#usage_bytes ⇒ Integer

The total number of bytes used by the files in the vector store.

Returns:

  • (Integer)


64
# File 'lib/openai/models/vector_store.rb', line 64

required :usage_bytes, Integer

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/vector_store.rb', line 181

Instance Method Details

#to_hash ⇒ { id: String, created_at: Integer, file_counts: OpenAI::VectorStore::FileCounts, last_active_at: Integer?, metadata: OpenAI::Models::metadata?, name: String, ?object: :vector_store, status: OpenAI::Models::VectorStore::status, usage_bytes: Integer, ?expires_after: OpenAI::VectorStore::ExpiresAfter, ?expires_at: Integer? }

Returns:

  • ({ id: String, created_at: Integer, file_counts: OpenAI::VectorStore::FileCounts, last_active_at: Integer?, metadata: OpenAI::Models::metadata?, name: String, ?object: :vector_store, status: OpenAI::Models::VectorStore::status, usage_bytes: Integer, ?expires_after: OpenAI::VectorStore::ExpiresAfter, ?expires_at: Integer? })


102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'sig/openai/models/vector_store.rbs', line 102

def to_hash: -> {
  id: String,
  created_at: Integer,
  file_counts: OpenAI::VectorStore::FileCounts,
  last_active_at: Integer?,
  metadata: OpenAI::Models::metadata?,
  name: String,
  ?object: :vector_store,
  status: OpenAI::Models::VectorStore::status,
  usage_bytes: Integer,
  ?expires_after: OpenAI::VectorStore::ExpiresAfter,
  ?expires_at: Integer?
}