@@ -61,15 +61,15 @@ def _truncate(self, obj, max_items=2):
61
61
62
62
63
63
@dataclass
64
- class CompositeQueryResults :
64
+ class QueryNamespacesResults :
65
65
usage : Usage
66
66
matches : List [ScoredVectorWithNamespace ]
67
67
68
68
def __getitem__ (self , key ):
69
69
if hasattr (self , key ):
70
70
return getattr (self , key )
71
71
else :
72
- raise KeyError (f"'{ key } ' not found in CompositeQueryResults " )
72
+ raise KeyError (f"'{ key } ' not found in QueryNamespacesResults " )
73
73
74
74
def __repr__ (self ):
75
75
return json .dumps (
@@ -110,7 +110,7 @@ def __init__(self, top_k: int):
110
110
self .insertion_counter = 0
111
111
self .is_dotproduct = None
112
112
self .read = False
113
- self .final_results : Optional [CompositeQueryResults ] = None
113
+ self .final_results : Optional [QueryNamespacesResults ] = None
114
114
115
115
def _is_dotproduct_index (self , matches ):
116
116
# The interpretation of the score depends on the similar metric used.
@@ -160,7 +160,7 @@ def add_results(self, results: Dict[str, Any]):
160
160
else :
161
161
self ._process_matches (matches , ns , self ._non_dotproduct_heap_item )
162
162
163
- def get_results (self ) -> CompositeQueryResults :
163
+ def get_results (self ) -> QueryNamespacesResults :
164
164
if self .read :
165
165
if self .final_results is not None :
166
166
return self .final_results
@@ -169,7 +169,7 @@ def get_results(self) -> CompositeQueryResults:
169
169
raise ValueError ("Results have already been read. Cannot get results again." )
170
170
self .read = True
171
171
172
- self .final_results = CompositeQueryResults (
172
+ self .final_results = QueryNamespacesResults (
173
173
usage = Usage (read_units = self .usage_read_units ),
174
174
matches = [
175
175
ScoredVectorWithNamespace (heapq .heappop (self .heap )) for _ in range (len (self .heap ))
0 commit comments