Parameters
Parameter | Type | Description |
---|---|---|
index_name | str | Name of the index to create. Must be unique. |
index_key | bytes | 32-byte encryption key for the index, used to secure the index data. |
index_config | IndexConfig | (Optional) Configuration specifying the index type and parameters. When not provided, uses IndexIVFFlat() defaults. |
max_cache_size | int | (Optional) Maximum size of local cache to keep for encrypted index (megabytes). Defaults to 0 . |
embedding_model | str | (Optional) Name of the SentenceTransformer model to use for automatic text embeddings. |
metric | str | (Optional) Distance metric to use: “euclidean”, “cosine”, or “squared_euclidean”. Overrides the metric in index_config . Defaults to “euclidean”. |
logger | Logger | (Optional) Logger instance for capturing operation logs. Defaults to None . |
For more info on auto-generating embeddings, refer to Auto-Generate Embeddings.
Returns
EncryptedIndex
: An instance of the newly created encrypted index.
Exceptions
ValueError
ValueError
- Throws if the index name is not unique.
- Throws if the index configuration is invalid.
RuntimeError
RuntimeError
- Throws if the index could not be created.