Parameters
| Parameter | Type | Description |
|---|---|---|
items | VectorItem[] | Array of vector items to insert or update in the index |
VectorItem Structure
EachVectorItem must contain an id and may optionally include vector, contents, and metadata:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier for the vector item |
vector | number[] | Optional | The vector representation (required if no embedding model configured) |
contents | string | Buffer | Optional | Original text or binary content associated with the vector |
metadata | object | Optional | Additional structured data associated with the vector |
Returns
Promise<SuccessResponseModel>: A Promise that resolves to a success response object containing the operation status and message with the count of upserted vectors.
Exceptions
Error
Error
- Throws if the API request fails due to network connectivity issues.
- Throws if authentication fails (invalid API key).
- Throws if the encryption key is invalid for the specified index.
- Throws if there are internal server errors preventing the upsert.
Validation Errors
Validation Errors
- Throws if the
itemsarray is empty or contains invalid data. - Throws if vector dimensions don’t match the index configuration.
- Throws if required fields are missing from vector items.
- Throws if item IDs contain invalid characters or are too long.