crewplus 0.2.24__py3-none-any.whl → 0.2.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crewplus might be problematic. Click here for more details.
- crewplus/vectorstores/milvus/vdb_service.py +43 -44
- {crewplus-0.2.24.dist-info → crewplus-0.2.25.dist-info}/METADATA +1 -1
- {crewplus-0.2.24.dist-info → crewplus-0.2.25.dist-info}/RECORD +6 -6
- {crewplus-0.2.24.dist-info → crewplus-0.2.25.dist-info}/WHEEL +0 -0
- {crewplus-0.2.24.dist-info → crewplus-0.2.25.dist-info}/entry_points.txt +0 -0
- {crewplus-0.2.24.dist-info → crewplus-0.2.25.dist-info}/licenses/LICENSE +0 -0
|
@@ -373,49 +373,6 @@ class VDBService(object):
|
|
|
373
373
|
|
|
374
374
|
return vdb
|
|
375
375
|
|
|
376
|
-
def delete_old_indexes(self, url: str = None, vdb: Milvus = None) -> (bool | None):
|
|
377
|
-
""" Delete old indexes of the same source_url
|
|
378
|
-
|
|
379
|
-
Args:
|
|
380
|
-
url (str): source url
|
|
381
|
-
vdb (Milvus): Milvus/Zilliz instance
|
|
382
|
-
"""
|
|
383
|
-
self.logger.info(f"Delete old indexes of the same source_url:{url}")
|
|
384
|
-
|
|
385
|
-
if url is None or vdb is None:
|
|
386
|
-
return None
|
|
387
|
-
|
|
388
|
-
# Delete indexes of the same source_url
|
|
389
|
-
expr = f'source_url == "{url}" or source == "{url}"'
|
|
390
|
-
pks = vdb.get_pks(expr)
|
|
391
|
-
|
|
392
|
-
# Delete entities by pks
|
|
393
|
-
if pks is not None and len(pks) > 0 :
|
|
394
|
-
res = vdb.delete(pks)
|
|
395
|
-
self.logger.info("Deleted old indexes result: " + str(res))
|
|
396
|
-
return res
|
|
397
|
-
|
|
398
|
-
def delete_old_indexes_by_id(self, source_id: str = None, vdb: Milvus = None) -> (bool | None):
|
|
399
|
-
""" Delete old indexes of the same source_id
|
|
400
|
-
|
|
401
|
-
Args:
|
|
402
|
-
source_id (str): source id
|
|
403
|
-
"""
|
|
404
|
-
self.logger.info(f"Delete old indexes of the same source_id:{source_id}")
|
|
405
|
-
|
|
406
|
-
if source_id is None or vdb is None:
|
|
407
|
-
return None
|
|
408
|
-
|
|
409
|
-
# Delete indexes of the same source_id
|
|
410
|
-
expr = f'source_id == "{source_id}"'
|
|
411
|
-
pks = vdb.get_pks(expr)
|
|
412
|
-
|
|
413
|
-
# Delete entities by pks
|
|
414
|
-
if pks is not None and len(pks) > 0 :
|
|
415
|
-
res = vdb.delete(pks)
|
|
416
|
-
self.logger.info("Deleted old indexes result: " + str(res))
|
|
417
|
-
return res
|
|
418
|
-
|
|
419
376
|
def drop_collection(self, collection_name: str) -> None:
|
|
420
377
|
"""
|
|
421
378
|
Deletes a collection from the vector database and removes it from the cache.
|
|
@@ -461,4 +418,46 @@ class VDBService(object):
|
|
|
461
418
|
return RuntimeError(f"collection_name must be not null or check out your client to link milvus")
|
|
462
419
|
client.delete(collection_name=collection_name, filter=filter)
|
|
463
420
|
except Exception as e:
|
|
464
|
-
raise RuntimeError(f"delete collection data failed: {str(e)}")
|
|
421
|
+
raise RuntimeError(f"delete collection data failed: {str(e)}")
|
|
422
|
+
|
|
423
|
+
@staticmethod
|
|
424
|
+
def delete_old_indexes(url: str = None, vdb: Milvus = None) -> (bool | None):
|
|
425
|
+
""" Delete old indexes of the same source_url
|
|
426
|
+
|
|
427
|
+
Args:
|
|
428
|
+
url (str): source url
|
|
429
|
+
vdb (Milvus): Milvus/Zilliz instance
|
|
430
|
+
"""
|
|
431
|
+
# Logging is not performed in static method
|
|
432
|
+
if url is None or vdb is None:
|
|
433
|
+
return None
|
|
434
|
+
|
|
435
|
+
# Delete indexes of the same source_url
|
|
436
|
+
expr = f'source_url == "{url}" or source == "{url}"'
|
|
437
|
+
pks = vdb.get_pks(expr)
|
|
438
|
+
|
|
439
|
+
# Delete entities by pks
|
|
440
|
+
if pks is not None and len(pks) > 0 :
|
|
441
|
+
res = vdb.delete(pks)
|
|
442
|
+
return res
|
|
443
|
+
|
|
444
|
+
@staticmethod
|
|
445
|
+
def delete_old_indexes_by_id(source_id: str = None, vdb: Milvus = None) -> (bool | None):
|
|
446
|
+
""" Delete old indexes of the same source_id
|
|
447
|
+
|
|
448
|
+
Args:
|
|
449
|
+
source_id (str): source id
|
|
450
|
+
"""
|
|
451
|
+
# Logging is not performed in static method
|
|
452
|
+
if source_id is None or vdb is None:
|
|
453
|
+
return None
|
|
454
|
+
|
|
455
|
+
# Delete indexes of the same source_id
|
|
456
|
+
expr = f'source_id == "{source_id}"'
|
|
457
|
+
pks = vdb.get_pks(expr)
|
|
458
|
+
|
|
459
|
+
# Delete entities by pks
|
|
460
|
+
if pks is not None and len(pks) > 0 :
|
|
461
|
+
res = vdb.delete(pks)
|
|
462
|
+
return res
|
|
463
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
crewplus-0.2.
|
|
2
|
-
crewplus-0.2.
|
|
3
|
-
crewplus-0.2.
|
|
4
|
-
crewplus-0.2.
|
|
1
|
+
crewplus-0.2.25.dist-info/METADATA,sha256=NynftFjnRM1sFSQfe8PUWMRDuo1YOWyyyjgODaegtBs,4991
|
|
2
|
+
crewplus-0.2.25.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
|
3
|
+
crewplus-0.2.25.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
4
|
+
crewplus-0.2.25.dist-info/licenses/LICENSE,sha256=2_NHSHRTKB_cTcT_GXgcenOCtIZku8j343mOgAguTfc,1087
|
|
5
5
|
crewplus/__init__.py,sha256=m46HkZL1Y4toD619NL47Sn2Qe084WFFSFD7e6VoYKZc,284
|
|
6
6
|
crewplus/services/__init__.py,sha256=zUM4ZwUfGMBDx-j7Wehf_KC5yYXPTK8BK_oeO5veIXQ,398
|
|
7
7
|
crewplus/services/azure_chat_model.py,sha256=xPuIsQpLV5Y3Ntwe3eqvquhBjh35g65VlF22AWJdEcU,8648
|
|
@@ -14,9 +14,9 @@ crewplus/utils/schema_document_updater.py,sha256=frvffxn2vbi71fHFPoGb9hq7gH2azmm
|
|
|
14
14
|
crewplus/vectorstores/milvus/__init__.py,sha256=egGncAdjlXG6ekTQvKMKqhvKBifrUrPlsSB0-bpvq4A,229
|
|
15
15
|
crewplus/vectorstores/milvus/milvus_schema_manager.py,sha256=2IZT61LVui21Pt5Z3y8YYS2dYcwzkgUKxMq2NA0-lQE,9222
|
|
16
16
|
crewplus/vectorstores/milvus/schema_milvus.py,sha256=IvKdUCH451HJ-F3TUR5jDjqwQlQs4SEXAQ_th4JAnfc,12117
|
|
17
|
-
crewplus/vectorstores/milvus/vdb_service.py,sha256=
|
|
17
|
+
crewplus/vectorstores/milvus/vdb_service.py,sha256=wCltxZc0aD27iTu7wjveHqQWPEF2VyO4B2WGQCheeVs,21118
|
|
18
18
|
docs/GeminiChatModel.md,sha256=_IQyup3ofAa2HxfSurO1GYUEezTHYYt5Q1khYNVThGM,8040
|
|
19
19
|
docs/ModelLoadBalancer.md,sha256=aGHES1dcXPz4c7Y8kB5-vsCNJjriH2SWmjBkSGoYKiI,4398
|
|
20
20
|
docs/VDBService.md,sha256=Dw286Rrf_fsi13jyD3Bo4Sy7nZ_G7tYm7d8MZ2j9hxk,9375
|
|
21
21
|
docs/index.md,sha256=3tlc15uR8lzFNM5WjdoZLw0Y9o1P1gwgbEnOdIBspqc,1643
|
|
22
|
-
crewplus-0.2.
|
|
22
|
+
crewplus-0.2.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|