Skip to main content

vector_store_files

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

Overview

Namevector_store_files
TypeResource
Idopenai.vector_stores.vector_store_files

Fields

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints.
chunking_strategyobjectThe strategy used to chunk the file.
created_atintegerThe Unix timestamp (in seconds) for when the vector store file was created.
last_errorobjectThe last error associated with this vector store file. Will be null if there are no errors.
objectstringThe object type, which is always vector_store.file.
statusstringThe 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_bytesintegerThe total vector store usage in bytes. Note that this may be different from the original file size.
vector_store_idstringThe ID of the vector store that the File is attached to.

Methods

NameAccessible byRequired ParamsDescription
get_vector_store_fileSELECTfile_id, vector_store_id
list_vector_store_filesSELECTvector_store_id
create_vector_store_fileINSERTvector_store_id, data__file_id
delete_vector_store_fileDELETEfile_id, vector_store_id

SELECT examples

SELECT
id,
chunking_strategy,
created_at,
last_error,
object,
status,
usage_bytes,
vector_store_id
FROM openai.vector_stores.vector_store_files
WHERE vector_store_id = '{{ vector_store_id }}';

INSERT example

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

/*+ create */
INSERT INTO openai.vector_stores.vector_store_files (
data__file_id,
data__chunking_strategy,
vector_store_id
)
SELECT
'{{ file_id }}',
'{{ chunking_strategy }}',
'{{ vector_store_id }}'
;

DELETE example

Deletes the specified vector_store_files resource.

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