EncryptedIndex
instance based on the provided configuration.
Parameters
Parameter | Type | Description |
---|---|---|
indexName | string | Name of the index to create. Must be unique within the CyborgDB service. |
indexKey | Uint8Array | 32-byte encryption key for the index, used to secure the index data. |
indexConfig | IndexIVFPQModel | IndexIVFFlatModel | IndexIVFModel | Configuration object specifying the index type (ivf , ivfpq , or ivfflat ) and relevant parameters such as dimension , nLists , pqDim , and pqBits . |
embeddingModel | string | (Optional) Name of the embedding model used to auto-generate embeddings on the server. Defaults to undefined , no auto-generation. |
For more info on auto-generating embeddings, refer to Auto-Generate Embeddings.
Returns
Promise<EncryptedIndex>
: A Promise that resolves to an instance of the newly created encrypted index.
Exceptions
Error
Error
- Throws if the index name already exists on the server.
- Throws if the index configuration is invalid or missing required parameters.
- Throws if the encryption key is not exactly 32 bytes.
- Throws if the embedding model is not supported by the server.
Network/API Errors
Network/API Errors
- Throws if the API request fails due to network issues.
- Throws if the server returns an HTTP error status.
- Throws if authentication fails (invalid API key).