Skip to main content

vector_stores

Creates, updates, deletes, gets or lists a vector_stores resource.

Overview

Namevector_stores
TypeResource
Idopenai.vector_stores.vector_stores

Fields

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints.
namestringThe name of the vector store.
created_atintegerThe Unix timestamp (in seconds) for when the vector store was created.
expires_afterobjectThe expiration policy for a vector store.
expires_atintegerThe Unix timestamp (in seconds) for when the vector store will expire.
file_countsobject
last_active_atintegerThe Unix timestamp (in seconds) for when the vector store was last active.
metadataobjectSet 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 can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
objectstringThe object type, which is always vector_store.
statusstringThe 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_bytesintegerThe total number of bytes used by the files in the vector store.

Methods

NameAccessible byRequired ParamsDescription
get_vector_storeSELECTvector_store_id
list_vector_storesSELECT
create_vector_storeINSERT
delete_vector_storeDELETEvector_store_id
modify_vector_storeUPDATEvector_store_id

SELECT examples

SELECT
id,
name,
created_at,
expires_after,
expires_at,
file_counts,
last_active_at,
metadata,
object,
status,
usage_bytes
FROM openai.vector_stores.vector_stores
;

INSERT example

Use the following StackQL query and manifest file to create a new vector_stores resource.

/*+ create */
INSERT INTO openai.vector_stores.vector_stores (
data__file_ids,
data__name,
data__expires_after,
data__chunking_strategy,
data__metadata
)
SELECT
'{{ file_ids }}',
'{{ name }}',
'{{ expires_after }}',
'{{ chunking_strategy }}',
'{{ metadata }}'
;

UPDATE example

Updates a vector_stores resource.

/*+ update */
UPDATE openai.vector_stores.vector_stores
SET
name = '{{ name }}',
expires_after = '{{ expires_after }}',
metadata = '{{ metadata }}'
WHERE
vector_store_id = '{{ vector_store_id }}';

DELETE example

Deletes the specified vector_stores resource.

/*+ delete */
DELETE FROM openai.vector_stores.vector_stores
WHERE vector_store_id = '{{ vector_store_id }}';