filter_results_by_distance

filter_results_by_distance(results: list[list[tuple[autogen.agentchat.contrib.vectordb.base.Document, float]]], distance_threshold: float = -1) -> list[list[tuple[autogen.agentchat.contrib.vectordb.base.Document, float]]]

Filters results based on a distance threshold.

Parameters:
NameDescription
resultsQueryResultsThe query results.

List[List[Tuple[Document, float]]]

Type: list[list[tuple[autogen.agentchat.contrib.vectordb.base.Document, float]]]
distance_thresholdThe maximum distance allowed for results.

Type: float

Default: -1
Returns:
TypeDescription
list[list[tuple[autogen.agentchat.contrib.vectordb.base.Document, float]]]QueryResults | A filtered results containing only distances smaller than the threshold.