Skip to content

Commit

Permalink
Fix vdb merge error (#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltcow authored Mar 4, 2024
1 parent 05ce7b9 commit f322d9b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 23 additions & 14 deletions api/core/rag/datasource/vdb/qdrant/qdrant_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,30 @@ def delete_by_metadata_field(self, key: str, value: str):

def delete(self):
from qdrant_client.http import models
filter = models.Filter(
must=[
models.FieldCondition(
key="group_id",
match=models.MatchValue(value=self._group_id),
from qdrant_client.http.exceptions import UnexpectedResponse

try:
filter = models.Filter(
must=[
models.FieldCondition(
key="group_id",
match=models.MatchValue(value=self._group_id),
),
],
)
self._client.delete(
collection_name=self._collection_name,
points_selector=FilterSelector(
filter=filter
),
],
)
self._client.delete(
collection_name=self._collection_name,
points_selector=FilterSelector(
filter=filter
),
)

)
except UnexpectedResponse as e:
# Collection does not exist, so return
if e.status_code == 404:
return
# Some other error occurred, so re-raise the exception
else:
raise e
def delete_by_ids(self, ids: list[str]) -> None:

from qdrant_client.http import models
Expand Down
2 changes: 1 addition & 1 deletion api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ safetensors==0.3.2
zhipuai==1.0.7
werkzeug~=3.0.1
pymilvus==2.3.0
qdrant-client==1.6.4
qdrant-client==1.7.3
cohere~=4.44
pyyaml~=6.0.1
numpy~=1.25.2
Expand Down

0 comments on commit f322d9b

Please sign in to comment.