Parameters
Where each
item dictionary has the following fields:
If embedding auto-generation is enabled (by setting the
embedding_model parameter in create_index()), then the vector parameter is optional.
If vector provided, then it will be used (its dimensionality must match that of the embedding_model).
If vector is not provided, a vector embedding will be auto-generated from contents using sentence-transformers. contents must be text in this case.Exceptions
ValueError
ValueError
- Throws if the vector dimensions are incompatible with the index configuration.
- Throws if the index was not created or loaded yet.
RuntimeError
RuntimeError
- Throws if the vectors could not be upserted.
Example Usage
Per-operation key override
The simple calls above reuse the key supplied atcreate_index() / load_index(). You may instead pass index_key= (and user_id= for an RBAC user) to override the per-operation key. This is required in stateless/service deployments that reload the index per request:
Upsert Secondary Overload: NumPy Array Format
- A list of strings or 1D array of identifiers for the unique IDs.
- A 2D array of float32 values for the vector embeddings.
Parameters
Exceptions
ValueError
ValueError
- Throws if the vector dimensions are incompatible with the index configuration.
- Throws if the index was not created or loaded yet.
RuntimeError
RuntimeError
- Throws if the vectors could not be upserted.