davidkhala.ai 0.1.4__py3-none-any.whl → 0.1.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.
|
@@ -178,12 +178,14 @@ class ChunkDict(TypedDict):
|
|
|
178
178
|
class Document(API):
|
|
179
179
|
def __init__(self, d: Dataset.Instance, document_id: str):
|
|
180
180
|
super().__init__(d.api_key, f"{d.base_url}/documents/{document_id}")
|
|
181
|
+
|
|
182
|
+
def exist(self):
|
|
181
183
|
try:
|
|
182
184
|
self.get()
|
|
183
|
-
|
|
185
|
+
return True
|
|
184
186
|
except requests.exceptions.HTTPError as e:
|
|
185
187
|
if e.response.status_code == 404:
|
|
186
|
-
|
|
188
|
+
return False
|
|
187
189
|
else:
|
|
188
190
|
raise e
|
|
189
191
|
|
|
@@ -200,3 +202,7 @@ class Document(API):
|
|
|
200
202
|
for chunk_batch in Iterator(self.paginate_chunks, None):
|
|
201
203
|
for chunk in chunk_batch:
|
|
202
204
|
yield chunk
|
|
205
|
+
|
|
206
|
+
def delete(self):
|
|
207
|
+
if self.exist():
|
|
208
|
+
self.request(self.base_url, "DELETE")
|
|
@@ -7,7 +7,7 @@ davidkhala/ai/agent/langgraph.py,sha256=jrc_Yvgo7eJjd3y5UJn0t1FzpnObDGYscwgsuVl2
|
|
|
7
7
|
davidkhala/ai/agent/ragflow.py,sha256=UaK31us6V0NhAPCthGo07rQsm72vlR-McmihC_NDe1g,273
|
|
8
8
|
davidkhala/ai/agent/dify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
davidkhala/ai/agent/dify/base.py,sha256=V4BIhG9oTg9ayPZnYVxxA1Yobl2C4ukSWEOu2U_l0Tw,259
|
|
10
|
-
davidkhala/ai/agent/dify/knowledge.py,sha256=
|
|
10
|
+
davidkhala/ai/agent/dify/knowledge.py,sha256=jWx-DmYLvK8ZJ7dMuayKAKnOMW2uehpFJu6jnj-grf8,6328
|
|
11
11
|
davidkhala/ai/ali/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
davidkhala/ai/ali/dashscope.py,sha256=SZIzRhVHlLx3s5I2RNUh2-u8OoSdrbvoN5e1k8Mh8N0,1943
|
|
13
13
|
davidkhala/ai/api/__init__.py,sha256=q2Ro5nhW5kJx2CYR1MRVamjTT5tTexPZwhrS2hwAvFM,1319
|
|
@@ -22,6 +22,6 @@ davidkhala/ai/huggingface/inference.py,sha256=bYN0PtLF2CaIHzdTP4LaTALJhcawvuLnLR
|
|
|
22
22
|
davidkhala/ai/openai/__init__.py,sha256=GXzWaw2ER3YFGHG6TPD9SmAHV6Tpsnqxj6tXlaWsrko,1897
|
|
23
23
|
davidkhala/ai/openai/azure.py,sha256=QR1uZj8qAyhpCjo3Ks5zNV8GfOp3-enyZs6fBvV-MkA,1110
|
|
24
24
|
davidkhala/ai/openai/native.py,sha256=MB0nDnzCOj_M42RMhdK3HTMVnxGnwpLT2GeLwSrepwI,704
|
|
25
|
-
davidkhala_ai-0.1.
|
|
26
|
-
davidkhala_ai-0.1.
|
|
27
|
-
davidkhala_ai-0.1.
|
|
25
|
+
davidkhala_ai-0.1.5.dist-info/METADATA,sha256=O1e0C_WHO5hAtEgn2o_-lVoVItJk_AYP5vfWe_M3DWs,1098
|
|
26
|
+
davidkhala_ai-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
27
|
+
davidkhala_ai-0.1.5.dist-info/RECORD,,
|
|
File without changes
|