HybridLocalIndex 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.List[List[float]]0 (List[List[float]]1): List of sparse embeddings to add to the index.
aadd
add method.
Arguments:
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(embeddings0): List of metadata to add to the index.embeddings1 (embeddings2): List of sparse embeddings to add to the index.
get_utterances
include_metadata(bool): Whether to include function schemas and metadata in the returned Utterance objects - HybridLocalIndex doesn’t include metadata so this parameter is ignored.
List[Utterance]: A list of Utterance objects.
query
vector(np.ndarray): The query vector to search for.top_k(int, optional): The number of top results to return, defaults to 5.route_filter(Optional[List[str]], optional): A list of route names to filter the search results, defaults to None.sparse_vector(dict[int, float]): The sparse vector to search for, must be provided.
aquery
query method as everything uses numpy computations which is CPU-bound
and so no benefit can be gained from making this async.
Arguments:
vector(np.ndarray): The query vector to search for.top_k(int, optional): The number of top results to return, defaults to 5.route_filter(Optional[List[str]], optional): A list of route names to filter the search results, defaults to None.sparse_vector(dict[int, float]): The sparse vector to search for, must be provided.
aget_routes
List[str]: A list of routes.
delete
route_name(str): The name of the route to delete.
delete_index
None: None
