The name of the collection to use
Add records to the index.
Arguments:
embeddings
(List[List[float]]
): The embeddings to add.routes
(List[str]
): The routes to add.utterances
(List[str]
): The utterances to add.function_schemas
(Optional[List[Dict[str, Any]]]
): The function schemas to add.metadata_list
(List[Dict[str, Any]]
): The metadata to add.List[List[float]]
0 (List[List[float]]
1): The batch size to use for the upload.Gets a list of route and utterance objects currently stored in the index.
Arguments:
include_metadata
(bool
): Whether to include function schemas and metadata in
the returned Utterance objects - QdrantIndex does not currently support this
parameter so it is ignored. If required for your use-case please reach out to
semantic-router maintainers on GitHub via an issue or PR.Returns:
List[Utterance]
: A list of Utterance objects.
Delete records from the index.
Arguments:
route_name
(str
): The name of the route to delete.Describe the index.
Returns:
IndexConfig
: The index configuration.
Checks if the index is ready to be used.
Returns:
bool
: True if the index is ready, False otherwise.
Query the index.
Arguments:
vector
(np.ndarray
): The vector to query.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The route filter to apply.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to query.Returns:
Tuple[np.ndarray, List[str]]
: A tuple of the scores and route names.
Asynchronously query the index.
Arguments:
vector
(np.ndarray
): The vector to query.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The route filter to apply.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to query.Returns:
Tuple[np.ndarray, List[str]]
: A tuple of the scores and route names.
Asynchronously get all routes from the index.
Returns:
List[str]
: A list of routes.
Delete the index.
Returns:
None
: None
Convert the metric to a Qdrant distance metric.
Arguments:
metric
(Metric
): The metric to convert.Returns:
Distance
: The converted metric.
Returns the total number of vectors in the index. If the index is not initialized
returns 0.
Returns:
int
: The total number of vectors.
Asynchronously delete records from the index by route name.
Arguments:
route_name
(str
): The name of the route to delete.Returns:
list[str]
: List of IDs of the vectors deleted (empty list, as Qdrant does not return IDs).
Asynchronously delete the index (collection) from Qdrant.
Returns:
None
: None
Checks if the index is ready to be used asynchronously.
Asynchronously add records to the index, including metadata in the payload.
Asynchronously gets a list of route and utterance objects currently stored in the index, including metadata.
The name of the collection to use
Add records to the index.
Arguments:
embeddings
(List[List[float]]
): The embeddings to add.routes
(List[str]
): The routes to add.utterances
(List[str]
): The utterances to add.function_schemas
(Optional[List[Dict[str, Any]]]
): The function schemas to add.metadata_list
(List[Dict[str, Any]]
): The metadata to add.List[List[float]]
0 (List[List[float]]
1): The batch size to use for the upload.Gets a list of route and utterance objects currently stored in the index.
Arguments:
include_metadata
(bool
): Whether to include function schemas and metadata in
the returned Utterance objects - QdrantIndex does not currently support this
parameter so it is ignored. If required for your use-case please reach out to
semantic-router maintainers on GitHub via an issue or PR.Returns:
List[Utterance]
: A list of Utterance objects.
Delete records from the index.
Arguments:
route_name
(str
): The name of the route to delete.Describe the index.
Returns:
IndexConfig
: The index configuration.
Checks if the index is ready to be used.
Returns:
bool
: True if the index is ready, False otherwise.
Query the index.
Arguments:
vector
(np.ndarray
): The vector to query.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The route filter to apply.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to query.Returns:
Tuple[np.ndarray, List[str]]
: A tuple of the scores and route names.
Asynchronously query the index.
Arguments:
vector
(np.ndarray
): The vector to query.top_k
(int
): The number of results to return.route_filter
(Optional[List[str]]
): The route filter to apply.sparse_vector
(dict[int, float] | SparseEmbedding | None
): The sparse vector to query.Returns:
Tuple[np.ndarray, List[str]]
: A tuple of the scores and route names.
Asynchronously get all routes from the index.
Returns:
List[str]
: A list of routes.
Delete the index.
Returns:
None
: None
Convert the metric to a Qdrant distance metric.
Arguments:
metric
(Metric
): The metric to convert.Returns:
Distance
: The converted metric.
Returns the total number of vectors in the index. If the index is not initialized
returns 0.
Returns:
int
: The total number of vectors.
Asynchronously delete records from the index by route name.
Arguments:
route_name
(str
): The name of the route to delete.Returns:
list[str]
: List of IDs of the vectors deleted (empty list, as Qdrant does not return IDs).
Asynchronously delete the index (collection) from Qdrant.
Returns:
None
: None
Checks if the index is ready to be used asynchronously.
Asynchronously add records to the index, including metadata in the payload.
Asynchronously gets a list of route and utterance objects currently stored in the index, including metadata.