mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 18:49:01 +08:00
Fix vdb merge error (#2650)
This commit is contained in:
parent
05ce7b9d5e
commit
f322d9bddb
@ -231,21 +231,30 @@ class QdrantVector(BaseVector):
|
|||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
from qdrant_client.http import models
|
from qdrant_client.http import models
|
||||||
filter = models.Filter(
|
from qdrant_client.http.exceptions import UnexpectedResponse
|
||||||
must=[
|
|
||||||
models.FieldCondition(
|
try:
|
||||||
key="group_id",
|
filter = models.Filter(
|
||||||
match=models.MatchValue(value=self._group_id),
|
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
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
)
|
except UnexpectedResponse as e:
|
||||||
self._client.delete(
|
# Collection does not exist, so return
|
||||||
collection_name=self._collection_name,
|
if e.status_code == 404:
|
||||||
points_selector=FilterSelector(
|
return
|
||||||
filter=filter
|
# Some other error occurred, so re-raise the exception
|
||||||
),
|
else:
|
||||||
)
|
raise e
|
||||||
|
|
||||||
def delete_by_ids(self, ids: list[str]) -> None:
|
def delete_by_ids(self, ids: list[str]) -> None:
|
||||||
|
|
||||||
from qdrant_client.http import models
|
from qdrant_client.http import models
|
||||||
|
@ -52,7 +52,7 @@ safetensors==0.3.2
|
|||||||
zhipuai==1.0.7
|
zhipuai==1.0.7
|
||||||
werkzeug~=3.0.1
|
werkzeug~=3.0.1
|
||||||
pymilvus==2.3.0
|
pymilvus==2.3.0
|
||||||
qdrant-client==1.6.4
|
qdrant-client==1.7.3
|
||||||
cohere~=4.44
|
cohere~=4.44
|
||||||
pyyaml~=6.0.1
|
pyyaml~=6.0.1
|
||||||
numpy~=1.25.2
|
numpy~=1.25.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user