Skip to content

Commit

Permalink
make api names consistent with grpc + fix a BUG (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
generall authored Oct 7, 2024
1 parent 4bcdedd commit 2cd8214
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 130 deletions.
4 changes: 2 additions & 2 deletions qdrant_client/async_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def search_groups(
) -> types.GroupsResult:
raise NotImplementedError()

async def search_distance_matrix_offsets(
async def search_matrix_offsets(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand All @@ -78,7 +78,7 @@ async def search_distance_matrix_offsets(
) -> types.SearchMatrixOffsetsResponse:
raise NotImplementedError()

async def search_distance_matrix_pairs(
async def search_matrix_pairs(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand Down
8 changes: 4 additions & 4 deletions qdrant_client/async_qdrant_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ async def recommend(
**kwargs,
)

async def search_distance_matrix_pairs(
async def search_matrix_pairs(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand Down Expand Up @@ -946,7 +946,7 @@ async def search_distance_matrix_pairs(
Return distance matrix using a pair-based encoding.
"""
assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}"
return await self._client.search_distance_matrix_pairs(
return await self._client.search_matrix_pairs(
collection_name=collection_name,
query_filter=query_filter,
limit=limit,
Expand All @@ -958,7 +958,7 @@ async def search_distance_matrix_pairs(
**kwargs,
)

async def search_distance_matrix_offsets(
async def search_matrix_offsets(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand Down Expand Up @@ -992,7 +992,7 @@ async def search_distance_matrix_offsets(
Return distance matrix using an offset-based encoding.
"""
assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}"
return await self._client.search_distance_matrix_offsets(
return await self._client.search_matrix_offsets(
collection_name=collection_name,
query_filter=query_filter,
limit=limit,
Expand Down
12 changes: 6 additions & 6 deletions qdrant_client/async_qdrant_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ async def search_groups(
)
).result

async def search_distance_matrix_pairs(
async def search_matrix_pairs(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand Down Expand Up @@ -863,9 +863,9 @@ async def search_distance_matrix_pairs(
)
return GrpcToRest.convert_search_matrix_pairs(response.result)
if isinstance(query_filter, grpc.Filter):
search_filter = GrpcToRest.convert_filter(model=query_filter)
query_filter = GrpcToRest.convert_filter(model=query_filter)
search_matrix_result = (
await self.openapi_client.points_api.search_points_matrix_pairs(
await self.openapi_client.points_api.search_matrix_pairs(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
Expand All @@ -881,7 +881,7 @@ async def search_distance_matrix_pairs(
assert search_matrix_result is not None, "Search matrix pairs returned None result"
return search_matrix_result

async def search_distance_matrix_offsets(
async def search_matrix_offsets(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand Down Expand Up @@ -915,9 +915,9 @@ async def search_distance_matrix_offsets(
)
return GrpcToRest.convert_search_matrix_offsets(response.result)
if isinstance(query_filter, grpc.Filter):
search_filter = GrpcToRest.convert_filter(model=query_filter)
query_filter = GrpcToRest.convert_filter(model=query_filter)
search_matrix_result = (
await self.openapi_client.points_api.search_points_matrix_offsets(
await self.openapi_client.points_api.search_matrix_offsets(
collection_name=collection_name,
consistency=consistency,
timeout=timeout,
Expand Down
8 changes: 4 additions & 4 deletions qdrant_client/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def search_groups(
) -> types.GroupsResult:
raise NotImplementedError()

def search_distance_matrix_offsets(
def search_matrix_offsets(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand All @@ -69,9 +69,9 @@ def search_distance_matrix_offsets(
using: Optional[str] = None,
**kwargs: Any,
) -> types.SearchMatrixOffsetsResponse:
raise NotImplementedError()
raise NotImplementedError()

def search_distance_matrix_pairs(
def search_matrix_pairs(
self,
collection_name: str,
query_filter: Optional[types.Filter] = None,
Expand All @@ -80,7 +80,7 @@ def search_distance_matrix_pairs(
using: Optional[str] = None,
**kwargs: Any,
) -> types.SearchMatrixPairsResponse:
raise NotImplementedError()
raise NotImplementedError()

def query_batch_points(
self,
Expand Down
Loading

0 comments on commit 2cd8214

Please sign in to comment.