vector_stores
Creates, updates, deletes, gets or lists a vector_stores
resource.
Overview
Name | vector_stores |
Type | Resource |
Id | openai.vector_stores.vector_stores |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The identifier, which can be referenced in API endpoints. |
name | string | The name of the vector store. |
created_at | integer | The Unix timestamp (in seconds) for when the vector store was created. |
expires_after | object | The expiration policy for a vector store. |
expires_at | integer | The Unix timestamp (in seconds) for when the vector store will expire. |
file_counts | object | |
last_active_at | integer | The Unix timestamp (in seconds) for when the vector store was last active. |
metadata | object | 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 can be a maximum of 64 characters long and values can be a maximum of 512 characters long. |
object | string | The object type, which is always vector_store . |
status | string | 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 | integer | The total number of bytes used by the files in the vector store. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_vector_store | SELECT | vector_store_id | |
list_vector_stores | SELECT |
| |
create_vector_store | INSERT |
| |
delete_vector_store | DELETE | vector_store_id | |
modify_vector_store | UPDATE | vector_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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: vector_stores
props:
- name: file_ids
value: array
- name: name
value: string
- name: expires_after
props:
- name: anchor
value: string
- name: days
value: integer
- name: chunking_strategy
props:
- name: type
value: string
- name: metadata
value: object
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 }}';