Create a vector store
Create a vector store with or without files.
Request
POST
https://ai.api.cloud.yandex.net/v1/vector_stores
Body
application/json
{
"file_ids": [
"example"
],
"name": "example",
"description": "example",
"expires_after": {
"anchor": "last_active_at",
"days": 1
},
"chunking_strategy": {
"type": "auto"
},
"metadata": {}
}
|
Name |
Description |
|
chunking_strategy |
Type: object One of 2 types
The chunking strategy used to chunk the file(s). If not set, will use the Example
|
|
description |
Type: string A description for the vector store. Can be used to describe the vector store's purpose. Example: |
|
expires_after |
Type: VectorStoreExpirationAfter The expiration policy for a vector store. Example
|
|
file_ids |
Type: string[] A list of File IDs that the vector store should use. Useful for tools like Max items: Example
|
|
metadata |
Type: Metadata Example
|
|
name |
Type: string The name of the vector store. Example: |
VectorStoreExpirationAfter
The expiration policy for a vector store.
|
Name |
Description |
|
anchor |
Type: string Anchor timestamp after which the expiration policy applies. Supported anchors: Const: Example: |
|
days |
Type: integer The number of days after the anchor time that the vector store will expire. Min value: Max value: |
Example
{
"anchor": "last_active_at",
"days": 1
}
AutoChunkingStrategyRequestParam
The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.
|
Name |
Description |
|
type |
Type: string Always Const: Example: |
Example
{
"type": "auto"
}
StaticChunkingStrategy
|
Name |
Description |
|
chunk_overlap_tokens |
Type: integer The number of tokens that overlap between chunks. The default value is Note that the overlap must not exceed half of |
|
max_chunk_size_tokens |
Type: integer The maximum number of tokens in each chunk. The default value is Min value: Max value: |
Example
{
"max_chunk_size_tokens": 100,
"chunk_overlap_tokens": 0
}
StaticChunkingStrategyRequestParam
Customize your own chunking strategy by setting chunk size and chunk overlap.
|
Name |
Description |
|
static |
Type: StaticChunkingStrategy Example
|
|
type |
Type: string Always Const: Example: |
Example
{
"type": "static",
"static": {
"max_chunk_size_tokens": 100,
"chunk_overlap_tokens": 0
}
}
Metadata
Any of 2 types
-
Type: object
[additional]
Type: string
Example:
exampleSet of 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.
Example
{} -
Type: null
Example:
null
Example
{}
Responses
200 OK
OK
Body
application/json
{
"id": "example",
"object": "vector_store",
"created_at": 0,
"name": "example",
"usage_bytes": 0,
"file_counts": {
"in_progress": 0,
"completed": 0,
"failed": 0,
"cancelled": 0,
"total": 0
},
"status": "expired",
"expires_after": {
"anchor": "last_active_at",
"days": 1
},
"expires_at": 0,
"last_active_at": 0,
"metadata": {}
}
|
Name |
Description |
||||||||||
|
created_at |
Type: integer The Unix timestamp (in seconds) for when the vector store was created. |
||||||||||
|
file_counts |
Type: object
Example
|
||||||||||
|
id |
Type: string The identifier, which can be referenced in API endpoints. Example: |
||||||||||
|
last_active_at |
Any of 2 types
Example: |
||||||||||
|
metadata |
Type: Metadata Example
|
||||||||||
|
name |
Type: string The name of the vector store. Example: |
||||||||||
|
object |
Type: string The object type, which is always Const: Example: |
||||||||||
|
status |
Type: string The status of the vector store, which can be either Enum: |
||||||||||
|
usage_bytes |
Type: integer The total number of bytes used by the files in the vector store. |
||||||||||
|
expires_after |
Type: VectorStoreExpirationAfter The expiration policy for a vector store. Example
|
||||||||||
|
expires_at |
Any of 2 types
Example: |