EncryptedIndex
instance based on the provided configuration.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
index_name | str | - | Unique name for the index |
index_key | bytes | - | 32-byte encryption key |
index_config | IndexConfig | None | (Optional) Index configuration object |
embedding_model | str | None | (Optional) Embedding model identifier |
metric | str | "euclidean" | (Optional) Distance metric to use ("euclidean" , "squared_euclidean" , or "cosine" ) |
Returns
An instance ofEncryptedIndex
configured with the provided parameters.
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.
Service Errors
Service Errors
- Throws if the CyborgDB service is unavailable or unreachable.
- Throws if there are internal server errors on the CyborgDB service.
Example Usage
Automatic Index Config
For more info on
generate_key
, refer to Generate Key.IVFFlat Index
IVFPQ Index with Embedding Model
For more info on auto-generating embeddings, refer to Auto-Generate Embeddings.