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 | - | Index configuration object |
embedding_model | str | None | (Optional) Embedding model identifier |
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.
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).
Example Usage
Basic usage of thecreate_index
method to create an IVF-Flat index: