Skip to content

Commit

Permalink
Reimplement the function retrieve_by_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 committed Dec 31, 2023
1 parent 6c318e8 commit 382f3a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Services/vector_db_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ async def retrieve_by_ids(self, image_id: list[str], with_vectors=False) -> list
ids=image_id,
with_payload=True,
with_vectors=with_vectors)
if len(image_id) != len(result):
logger.error("{} points not exist.", len(image_id) - len(result))
result_point_ids = {t.id for t in result}
missing_point_ids = set(image_id) - result_point_ids
raise PointNotFoundError(str(missing_point_ids))
return self._get_img_data_from_points(result)

async def validate_ids(self, image_id: list[str]) -> list[str]:
Expand Down

0 comments on commit 382f3a7

Please sign in to comment.