Parameters
Parameter | Type | Default | Description |
---|---|---|---|
ids | string[] | - | Array of vector IDs to retrieve from the index |
include | string[] | ["vector", "contents", "metadata"] | (Optional) Fields to include in the response. Valid options: "vector" , "contents" , "metadata" |
Returns
Promise<Array<object>>
: A Promise that resolves to an array of retrieved vector items, each containing the requested fields based on the include
parameter.
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 retrieval.
Validation Errors
Validation Errors
- Throws if the
ids
parameter is null, undefined, or empty. - Throws if the
include
parameter contains invalid field names.
Example Usage
Response Format
The method returns an array of objects with the following structure:Response Item Fields
Field | Type | Description |
---|---|---|
id | string | Unique identifier of the vector (always included) |
vector | number[] | The vector data (included if "vector" in include array) |
contents | Buffer | string | The content data, automatically decoded from base64 if needed (included if "contents" in include array) |
metadata | any | Associated metadata object (included if "metadata" in include array) |