BaseIndex Objects
add
embeddings
(List[List[float]]
): List of embeddings to add to the index.routes
(List[str]
): List of routes to add to the index.utterances
(List[str]
): List of utterances to add to the index.function_schemas
(Optional[List[Dict[str, Any]]]
): List of function schemas to add to the index.metadata_list
(List[Dict[str, Any]]
): List of metadata to add to the index.
aadd
embeddings
(List[List[float]]
): List of embeddings to add to the index.routes
(List[str]
): List of routes to add to the index.utterances
(List[str]
): List of utterances to add to the index.function_schemas
(Optional[List[Dict[str, Any]]]
): List of function schemas to add to the index.metadata_list
(List[Dict[str, Any]]
): List of metadata to add to the index.
get_utterances
include_metadata
(bool
): Whether to include function schemas and metadata in the returned Utterance objects.
List[Utterance]
: A list of Utterance objects.
aget_utterances
include_metadata
(bool
): Whether to include function schemas and metadata in the returned Utterance objects.
List[Utterance]
: A list of Utterance objects.
get_routes
List[Route]
: A list of Route objects.
delete
route_name
(str
): Name of the route to delete.
adelete
route_name
(str
): Name of the route to delete.
list[str]
: List of IDs of the vectors deleted.
describe
IndexConfig
: An IndexConfig object.
is_ready
bool
: True if the index is ready, False otherwise.
ais_ready
bool
: True if the index is ready, False otherwise.
query
vector
(np.ndarray
): The vector to search for.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The routes to filter the search by.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to search for.
Tuple[np.ndarray, List[str]]
: A tuple containing the query vector and a list of route names.
aquery
vector
(np.ndarray
): The vector to search for.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The routes to filter the search by.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to search for.
Tuple[np.ndarray, List[str]]
: A tuple containing the query vector and a list of route names.
aget_routes
NotImplementedError
: If the method is not implemented by the subclass.
list[tuple]
: A list of tuples, each containing a route name and an associated utterance.
delete_all
NotImplementedError
: If the method is not implemented by the subclass.
delete_index
NotImplementedError
: If the method is not implemented by the subclass.
adelete_index
lock
scope
(str | None
): The scope to lock.wait
(int
): The number of seconds to wait for the index to be unlocked, if set to 0, will raise an error if index is already locked/unlocked.
ConfigParameter
: The config parameter that was locked.
alock
__len__
int
: The total number of vectors.
alen
int
: The total number of vectors.
parse_route_info
metadata
(List[Dict[str, Any]]
): List of metadata dictionaries.
List[Tuple]
: A list of tuples, each containing route, utterance, function schema and additional metadata.