nuclia 4.9.4__py3-none-any.whl → 4.9.5__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.
nuclia/lib/kb.py CHANGED
@@ -455,12 +455,16 @@ class NucliaDBClient(BaseNucliaDBClient):
455
455
  handle_http_sync_errors(response)
456
456
  return response
457
457
 
458
- def delete_task(self, task_id: str) -> httpx.Response:
458
+ def delete_task(self, task_id: str, cleanup: bool = False) -> httpx.Response:
459
459
  if self.writer_session is None:
460
460
  raise Exception("KB not configured")
461
461
 
462
+ params = None
463
+ if cleanup:
464
+ params = {"cleanup": "true"}
465
+
462
466
  response: httpx.Response = self.writer_session.delete(
463
- f"{self.url}{DELETE_TASK.format(task_id=task_id)}",
467
+ f"{self.url}{DELETE_TASK.format(task_id=task_id)}", params=params
464
468
  )
465
469
  handle_http_sync_errors(response)
466
470
  return response
@@ -827,12 +831,16 @@ class AsyncNucliaDBClient(BaseNucliaDBClient):
827
831
  await handle_http_async_errors(response)
828
832
  return response
829
833
 
830
- async def delete_task(self, task_id: str) -> httpx.Response:
834
+ async def delete_task(self, task_id: str, cleanup: bool = False) -> httpx.Response:
831
835
  if self.writer_session is None:
832
836
  raise Exception("KB not configured")
833
837
 
838
+ params = None
839
+ if cleanup:
840
+ params = {"cleanup": "true"}
841
+
834
842
  response: httpx.Response = await self.writer_session.delete(
835
- f"{self.url}{DELETE_TASK.format(task_id=task_id)}",
843
+ f"{self.url}{DELETE_TASK.format(task_id=task_id)}", params=params
836
844
  )
837
845
  await handle_http_async_errors(response)
838
846
  return response
nuclia/sdk/task.py CHANGED
@@ -6,9 +6,9 @@ from nuclia.sdk.auth import NucliaAuth, AsyncNucliaAuth
6
6
  from nuclia_models.worker.tasks import (
7
7
  ApplyOptions,
8
8
  TaskStartKB,
9
- TaskResponse,
10
9
  TaskList,
11
10
  TaskName,
11
+ TaskResponse,
12
12
  PARAMETERS_TYPING,
13
13
  PublicTaskSet,
14
14
  TASKS,
@@ -64,7 +64,7 @@ class NucliaTask:
64
64
  return TaskResponse.model_validate(response.json())
65
65
 
66
66
  @kb
67
- def delete(self, *args, task_id: str, **kwargs):
67
+ def delete(self, *args, task_id: str, cleanup: bool = False, **kwargs):
68
68
  """
69
69
  Delete task
70
70
 
@@ -72,7 +72,7 @@ class NucliaTask:
72
72
  """
73
73
  ndb: NucliaDBClient = kwargs["ndb"]
74
74
  try:
75
- _ = ndb.delete_task(task_id=task_id)
75
+ _ = ndb.delete_task(task_id=task_id, cleanup=cleanup)
76
76
  except InvalidPayload:
77
77
  pass
78
78
 
@@ -158,7 +158,7 @@ class AsyncNucliaTask:
158
158
  return TaskResponse.model_validate(response.json())
159
159
 
160
160
  @kb
161
- async def delete(self, *args, task_id: str, **kwargs):
161
+ async def delete(self, *args, task_id: str, cleanup: bool = False, **kwargs):
162
162
  """
163
163
  Delete task
164
164
 
@@ -166,7 +166,7 @@ class AsyncNucliaTask:
166
166
  """
167
167
  ndb: AsyncNucliaDBClient = kwargs["ndb"]
168
168
  try:
169
- _ = await ndb.delete_task(task_id=task_id)
169
+ _ = await ndb.delete_task(task_id=task_id, cleanup=cleanup)
170
170
  except InvalidPayload:
171
171
  pass
172
172
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nuclia
3
- Version: 4.9.4
3
+ Version: 4.9.5
4
4
  Summary: Nuclia Python SDK
5
5
  Author-email: Nuclia <info@nuclia.com>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ nuclia/cli/run.py,sha256=B1hP0upSbSCqqT89WAwsd93ZxkAoF6ajVyLOdYmo8fU,1560
9
9
  nuclia/cli/utils.py,sha256=iZ3P8juBdAGvaRUd2BGz7bpUXNDHdPrC5p876yyZ2Cs,1223
10
10
  nuclia/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  nuclia/lib/conversations.py,sha256=M6qhL9NPEKroYF767S-Q2XWokRrjX02kpYTzRvZKwUE,149
12
- nuclia/lib/kb.py,sha256=hbWg-0pX1OCt9ezUXYcOfyWHahgmZLUQe2nlSycHetU,31364
12
+ nuclia/lib/kb.py,sha256=V1hX3aPdrrPX5slN11K7IwSA22E-M-k7rxfwwh1_Dts,31606
13
13
  nuclia/lib/models.py,sha256=ekEQrVIFU3aFvt60yQh-zpWkGNORBMSc7c5Hd_VzPzI,1564
14
14
  nuclia/lib/nua.py,sha256=qP6Gv9ck117kdqNuKVl_qHodrDE8CS8xdh_bdzeJMiQ,30631
15
15
  nuclia/lib/nua_chat.py,sha256=ApL1Y1FWvAVUt-Y9a_8TUSJIhg8-UmBSy8TlDPn6tD8,3874
@@ -33,7 +33,7 @@ nuclia/sdk/process.py,sha256=WuNnqaWprp-EABWDC_z7O2woesGIlYWnDUKozh7Ibr4,2241
33
33
  nuclia/sdk/remi.py,sha256=BEb3O9R2jOFlOda4vjFucKKGO1c2eTkqYZdFlIy3Zmo,4357
34
34
  nuclia/sdk/resource.py,sha256=0lSvD4e1FpN5iM9W295dOKLJ8hsXfIe8HKdo0HsVg20,13976
35
35
  nuclia/sdk/search.py,sha256=tHpx0gwVwSepa3dn7AX2iWs7JO0pQkjJk7v8TEoL7Gg,27742
36
- nuclia/sdk/task.py,sha256=UawH-7IneRIGVOiLdDQ2vDBwe5eI51UXRbLRRVeu3C4,6095
36
+ nuclia/sdk/task.py,sha256=V2M_44tkNB-edflf0mOjmgTg-w6pTjEYzlcCPkdJZYc,6175
37
37
  nuclia/sdk/upload.py,sha256=ZBzYROF3yP-77HcaR06OBsFjJAbTOCvF-nlxaqQZsT4,22720
38
38
  nuclia/sdk/zones.py,sha256=1ARWrTsTuzj8zguanpX3OaIw-3Qq_ULS_g4GG2mHxOA,342
39
39
  nuclia/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -63,9 +63,9 @@ nuclia/tests/test_nucliadb/test_crud.py,sha256=GuY76HRvt2DFaNgioKm5n0Aco1HnG7zzV
63
63
  nuclia/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  nuclia/tests/unit/test_export_import.py,sha256=xo_wVbjUnNlVV65ZGH7LtZ38qy39EkJp2hjOuTHC1nU,980
65
65
  nuclia/tests/unit/test_nua_responses.py,sha256=t_hIdVztTi27RWvpfTJUYcCL0lpKdZFegZIwLdaPNh8,319
66
- nuclia-4.9.4.dist-info/licenses/LICENSE,sha256=Ops2LTti_HJtpmWcanuUTdTY3vKDR1myJ0gmGBKC0FA,1063
67
- nuclia-4.9.4.dist-info/METADATA,sha256=2fk95GmG2Qa-GGAOPxWXWgA-gAGv-vEIHMRftKOsgA0,2341
68
- nuclia-4.9.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- nuclia-4.9.4.dist-info/entry_points.txt,sha256=iZHOyXPNS54r3eQmdi5So20xO1gudI9K2oP4sQsCJRw,46
70
- nuclia-4.9.4.dist-info/top_level.txt,sha256=cqn_EitXOoXOSUvZnd4q6QGrhm04pg8tLAZtem-Zfdo,7
71
- nuclia-4.9.4.dist-info/RECORD,,
66
+ nuclia-4.9.5.dist-info/licenses/LICENSE,sha256=Ops2LTti_HJtpmWcanuUTdTY3vKDR1myJ0gmGBKC0FA,1063
67
+ nuclia-4.9.5.dist-info/METADATA,sha256=SkwJpFksjfU0CEWqpLPdHCFeH8yQ3J9XJlp0LzGjRDE,2341
68
+ nuclia-4.9.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
+ nuclia-4.9.5.dist-info/entry_points.txt,sha256=iZHOyXPNS54r3eQmdi5So20xO1gudI9K2oP4sQsCJRw,46
70
+ nuclia-4.9.5.dist-info/top_level.txt,sha256=cqn_EitXOoXOSUvZnd4q6QGrhm04pg8tLAZtem-Zfdo,7
71
+ nuclia-4.9.5.dist-info/RECORD,,
File without changes