projectdavid 1.33.19__py3-none-any.whl → 1.33.20__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 projectdavid might be problematic. Click here for more details.
- projectdavid/clients/vectors.py +22 -22
- {projectdavid-1.33.19.dist-info → projectdavid-1.33.20.dist-info}/METADATA +1 -1
- {projectdavid-1.33.19.dist-info → projectdavid-1.33.20.dist-info}/RECORD +6 -6
- {projectdavid-1.33.19.dist-info → projectdavid-1.33.20.dist-info}/WHEEL +0 -0
- {projectdavid-1.33.19.dist-info → projectdavid-1.33.20.dist-info}/licenses/LICENSE +0 -0
- {projectdavid-1.33.19.dist-info → projectdavid-1.33.20.dist-info}/top_level.txt +0 -0
projectdavid/clients/vectors.py
CHANGED
|
@@ -245,32 +245,31 @@ class VectorStoreClient:
|
|
|
245
245
|
) -> ValidationInterface.VectorStoreFileRead:
|
|
246
246
|
processed = await self.file_processor.process_file(p)
|
|
247
247
|
texts, vectors = processed["chunks"], processed["vectors"]
|
|
248
|
-
line_data = processed.get("line_data") or []
|
|
249
|
-
|
|
250
|
-
base_md = meta or {}
|
|
251
|
-
base_md.update({"source": str(p), "file_name": p.name})
|
|
248
|
+
line_data = processed.get("line_data") or []
|
|
252
249
|
|
|
250
|
+
base_md = (meta or {}) | {"source": str(p), "file_name": p.name}
|
|
253
251
|
file_record_id = f"vsf_{uuid.uuid4()}"
|
|
254
252
|
|
|
255
|
-
# Build per‑chunk payload, now including page/lines if present
|
|
256
253
|
chunk_md = []
|
|
257
|
-
for i in
|
|
258
|
-
payload = {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"file_id": file_record_id,
|
|
262
|
-
}
|
|
263
|
-
if i < len(line_data): # ← NEW
|
|
264
|
-
payload.update(line_data[i]) # {'page': …, 'lines': …}
|
|
254
|
+
for i, txt in enumerate(texts):
|
|
255
|
+
payload = {**base_md, "chunk_index": i, "file_id": file_record_id}
|
|
256
|
+
if i < len(line_data):
|
|
257
|
+
payload.update(line_data[i]) # {'page':…, 'lines':…}
|
|
265
258
|
chunk_md.append(payload)
|
|
266
259
|
|
|
260
|
+
# 🔑 1. look up the backend store to get its *collection* name
|
|
261
|
+
store = self.retrieve_vector_store_sync(vector_store_id)
|
|
262
|
+
collection_name = store.collection_name
|
|
263
|
+
|
|
264
|
+
# 🔑 2. upsert via VectorStoreManager (auto-detects vector field)
|
|
267
265
|
self.vector_manager.add_to_store(
|
|
268
|
-
store_name=
|
|
266
|
+
store_name=collection_name,
|
|
269
267
|
texts=texts,
|
|
270
268
|
vectors=vectors,
|
|
271
269
|
metadata=chunk_md,
|
|
272
270
|
)
|
|
273
271
|
|
|
272
|
+
# 3. register the file with the API
|
|
274
273
|
resp = await self._request(
|
|
275
274
|
"POST",
|
|
276
275
|
f"/v1/vector-stores/{vector_store_id}/files",
|
|
@@ -318,10 +317,10 @@ class VectorStoreClient:
|
|
|
318
317
|
vector_field=vector_field,
|
|
319
318
|
)
|
|
320
319
|
|
|
321
|
-
async def _delete_vs_async(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
qres = self.vector_manager.delete_store(
|
|
320
|
+
async def _delete_vs_async(self, vector_store_id: str, permanent: bool):
|
|
321
|
+
# collection deletion must use the *collection* name
|
|
322
|
+
store = self.retrieve_vector_store_sync(vector_store_id)
|
|
323
|
+
qres = self.vector_manager.delete_store(store.collection_name)
|
|
325
324
|
await self._request(
|
|
326
325
|
"DELETE",
|
|
327
326
|
f"/v1/vector-stores/{vector_store_id}",
|
|
@@ -334,10 +333,11 @@ class VectorStoreClient:
|
|
|
334
333
|
"qdrant_result": qres,
|
|
335
334
|
}
|
|
336
335
|
|
|
337
|
-
async def _delete_file_async(
|
|
338
|
-
self
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
async def _delete_file_async(self, vector_store_id: str, file_path: str):
|
|
337
|
+
store = self.retrieve_vector_store_sync(vector_store_id)
|
|
338
|
+
fres = self.vector_manager.delete_file_from_store(
|
|
339
|
+
store.collection_name, file_path
|
|
340
|
+
)
|
|
341
341
|
await self._request(
|
|
342
342
|
"DELETE",
|
|
343
343
|
f"/v1/vector-stores/{vector_store_id}/files",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: projectdavid
|
|
3
|
-
Version: 1.33.
|
|
3
|
+
Version: 1.33.20
|
|
4
4
|
Summary: Python SDK for interacting with the Entities Assistant API.
|
|
5
5
|
Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
|
|
6
6
|
License: PolyForm Noncommercial License 1.0.0
|
|
@@ -21,7 +21,7 @@ projectdavid/clients/threads_client.py,sha256=ekzU5w14zftmtmFkiec3NC90Of-_KVSUY1
|
|
|
21
21
|
projectdavid/clients/tools_client.py,sha256=GkCVOmwpAoPqVt6aYmH0G1HIFha3iEwR9IIf9teR0j8,11487
|
|
22
22
|
projectdavid/clients/users_client.py,sha256=eCuUb9qvyH1GUFhZu6TRL9zdoK-qzHSs8-Vmrk_0mmg,13729
|
|
23
23
|
projectdavid/clients/vector_store_manager.py,sha256=4uedMZ7foNr7s4Lsq5-FSN5kl4lR-Y8-nUlkoO2ff8M,14119
|
|
24
|
-
projectdavid/clients/vectors.py,sha256=
|
|
24
|
+
projectdavid/clients/vectors.py,sha256=TcY-kMsFFbjZV3hIJ4qlRBZvaxtTbIAVzGS0GdQJNuI,31956
|
|
25
25
|
projectdavid/clients/vision-file_processor.py,sha256=19ft9IUeY5x9_22vC4JqndiFlpDYyUn6z1ygv-EV2NE,16852
|
|
26
26
|
projectdavid/clients/vision_vectors.py,sha256=cysPVbUzW3byB82MTqG2X1Iz5ZAe82WTS1JfQcoqVhE,40229
|
|
27
27
|
projectdavid/constants/platform.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -37,8 +37,8 @@ projectdavid/utils/monitor_launcher.py,sha256=3YAgJdeuaUvq3JGvpA4ymqFsAnk29nH5q9
|
|
|
37
37
|
projectdavid/utils/peek_gate.py,sha256=5whMRnDOQjATRpThWDJkvY9ScXuJ7Sd_-9rvGgXeTAQ,2532
|
|
38
38
|
projectdavid/utils/run_monitor.py,sha256=F_WkqIP-qnWH-4llIbileWWLfRj2Q1Cg-ni23SR1rec,3786
|
|
39
39
|
projectdavid/utils/vector_search_formatter.py,sha256=YTe3HPGec26qGY7uxY8_GS8lc4QaN6aNXMzkl29nZpI,1735
|
|
40
|
-
projectdavid-1.33.
|
|
41
|
-
projectdavid-1.33.
|
|
42
|
-
projectdavid-1.33.
|
|
43
|
-
projectdavid-1.33.
|
|
44
|
-
projectdavid-1.33.
|
|
40
|
+
projectdavid-1.33.20.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
|
|
41
|
+
projectdavid-1.33.20.dist-info/METADATA,sha256=pV7oSTxkZfCgK-GcJ1u2HZLvWr16vZssNGpQAmeJ1oY,11555
|
|
42
|
+
projectdavid-1.33.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
43
|
+
projectdavid-1.33.20.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
|
|
44
|
+
projectdavid-1.33.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|