projectdavid 1.33.19__tar.gz → 1.33.21__tar.gz

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.
Files changed (71) hide show
  1. {projectdavid-1.33.19 → projectdavid-1.33.21}/CHANGELOG.md +14 -0
  2. {projectdavid-1.33.19/src/projectdavid.egg-info → projectdavid-1.33.21}/PKG-INFO +1 -1
  3. {projectdavid-1.33.19 → projectdavid-1.33.21}/pyproject.toml +1 -1
  4. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/vector_store_manager.py +34 -17
  5. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/vectors.py +22 -22
  6. {projectdavid-1.33.19 → projectdavid-1.33.21/src/projectdavid.egg-info}/PKG-INFO +1 -1
  7. {projectdavid-1.33.19 → projectdavid-1.33.21}/LICENSE +0 -0
  8. {projectdavid-1.33.19 → projectdavid-1.33.21}/MANIFEST.in +0 -0
  9. {projectdavid-1.33.19 → projectdavid-1.33.21}/README.md +0 -0
  10. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/assistants.md +0 -0
  11. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/code_interpretation.md +0 -0
  12. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/database.md +0 -0
  13. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/database_assistant_example.md +0 -0
  14. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/docker_comtainers.md +0 -0
  15. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/file_search.md +0 -0
  16. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/files.md +0 -0
  17. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/function_call_definition.md +0 -0
  18. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/function_calls.md +0 -0
  19. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/handling_function_calls.md +0 -0
  20. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/inference.md +0 -0
  21. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/messages.md +0 -0
  22. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/runs.md +0 -0
  23. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/streams.md +0 -0
  24. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/threads.md +0 -0
  25. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/tools.md +0 -0
  26. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/users.md +0 -0
  27. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/vector_store.md +0 -0
  28. {projectdavid-1.33.19 → projectdavid-1.33.21}/docs/versioning.md +0 -0
  29. {projectdavid-1.33.19 → projectdavid-1.33.21}/setup.cfg +0 -0
  30. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/__init__.py +0 -0
  31. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/_version.py +0 -0
  32. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/actions_client.py +0 -0
  33. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/api_key_client.py +0 -0
  34. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/assistants_client.py +0 -0
  35. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/base_client.py +0 -0
  36. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/base_vector_store.py +0 -0
  37. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/event_handler.py +0 -0
  38. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/file_processor.py +0 -0
  39. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/file_search.py +0 -0
  40. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/files_client.py +0 -0
  41. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/inference_client.py +0 -0
  42. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/messages_client.py +0 -0
  43. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/runs.py +0 -0
  44. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/synchronous_inference_wrapper.py +0 -0
  45. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/threads_client.py +0 -0
  46. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/tools_client.py +0 -0
  47. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/users_client.py +0 -0
  48. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/vision-file_processor.py +0 -0
  49. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/clients/vision_vectors.py +0 -0
  50. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/constants/platform.py +0 -0
  51. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/decorators.py +0 -0
  52. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/entity.py +0 -0
  53. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/events.py +0 -0
  54. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/serializers.py +0 -0
  55. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/services/logging_service.py +0 -0
  56. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/synthesis/__init__.py +0 -0
  57. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/synthesis/llm_synthesizer.py +0 -0
  58. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/synthesis/prompt.py +0 -0
  59. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/synthesis/reranker.py +0 -0
  60. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/synthesis/retriever.py +0 -0
  61. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/__init__.py +0 -0
  62. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/function_call_suppressor.py +0 -0
  63. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/monitor_launcher.py +0 -0
  64. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/peek_gate.py +0 -0
  65. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/run_monitor.py +0 -0
  66. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid/utils/vector_search_formatter.py +0 -0
  67. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid.egg-info/SOURCES.txt +0 -0
  68. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid.egg-info/dependency_links.txt +0 -0
  69. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid.egg-info/requires.txt +0 -0
  70. {projectdavid-1.33.19 → projectdavid-1.33.21}/src/projectdavid.egg-info/top_level.txt +0 -0
  71. {projectdavid-1.33.19 → projectdavid-1.33.21}/tests/test_clients.py +0 -0
@@ -1,3 +1,17 @@
1
+ ## [1.33.21](https://github.com/frankie336/projectdavid/compare/v1.33.20...v1.33.21) (2025-06-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Back out from vision support - resource issue. Revisit in grand plan-13 ([f43db04](https://github.com/frankie336/projectdavid/commit/f43db045d2c99be59586d7b0700f0a55f2efefd7))
7
+
8
+ ## [1.33.20](https://github.com/frankie336/projectdavid/compare/v1.33.19...v1.33.20) (2025-06-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Back out from vision support - resource issue. Revisit in grand plan-11 ([a40b74e](https://github.com/frankie336/projectdavid/commit/a40b74ecadb38df56134d722c1edd000f9d06537))
14
+
1
15
  ## [1.33.19](https://github.com/frankie336/projectdavid/compare/v1.33.18...v1.33.19) (2025-06-16)
2
16
 
3
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid
3
- Version: 1.33.19
3
+ Version: 1.33.21
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "projectdavid"
7
- version = "1.33.19"
7
+ version = "1.33.21"
8
8
  description = "Python SDK for interacting with the Entities Assistant API."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -139,13 +139,17 @@ class VectorStoreManager(BaseVectorStore):
139
139
  metadata: List[dict],
140
140
  vector_name: Optional[str] = None,
141
141
  ) -> Dict[str, Any]:
142
- """Upsert vectors + payloads into *store_name*.
142
+ """
143
+ Upsert vectors + payloads into *store_name*.
144
+
145
+ If *vector_name* is omitted the manager:
143
146
 
144
- If *vector_name* is omitted, the manager auto‑detects the sole vector
145
- field. If multiple fields exist it raises a clear error.
147
+ auto-detects the single vector field for classic (unnamed) collections
148
+ auto-detects the sole key for named-vector collections with exactly one field
149
+ • raises if multiple named fields exist.
146
150
  """
147
151
 
148
- # ---- validate input ------------------------------------------------
152
+ # ─── input validation ───────────────────────────────────────────────
149
153
  if not vectors:
150
154
  raise ValueError("Empty vectors list")
151
155
  expected = len(vectors[0])
@@ -153,22 +157,33 @@ class VectorStoreManager(BaseVectorStore):
153
157
  if len(vec) != expected or not all(isinstance(v, float) for v in vec):
154
158
  raise ValueError(f"Vector {i} malformed: expected {expected} floats")
155
159
 
156
- # ---- autodetect vector field --------------------------------------
160
+ # ─── auto-detect vector field ───────────────────────────────────────
157
161
  if vector_name is None:
158
162
  coll_info = self.client.get_collection(collection_name=store_name)
159
163
  v_cfg = coll_info.config.params.vectors
160
- vector_fields = list(v_cfg.keys()) if isinstance(v_cfg, dict) else [v_cfg]
161
- if len(vector_fields) == 1:
162
- vector_name = vector_fields[0]
163
- log.debug(
164
- "Auto‑detected vector_name=%r for store=%s", vector_name, store_name
165
- )
164
+
165
+ if isinstance(v_cfg, dict): # modern named-vector schema
166
+ vector_fields = list(v_cfg.keys())
167
+ if len(vector_fields) == 1: # exactly one → safe default
168
+ vector_name = vector_fields[0]
169
+ log.debug(
170
+ "Auto-detected vector_name=%r for store=%s",
171
+ vector_name,
172
+ store_name,
173
+ )
174
+ else: # >1 named fields → ambiguous
175
+ raise ValueError(
176
+ f"Multiple vector fields {vector_fields}; please specify vector_name"
177
+ )
166
178
  else:
167
- raise ValueError(
168
- f"Multiple vector fields {vector_fields}; please specify vector_name"
179
+ # legacy single-vector schema → leave vector_name as None
180
+ log.debug(
181
+ "Collection %s uses legacy single-vector schema; "
182
+ "upserting without vector_name",
183
+ store_name,
169
184
  )
170
185
 
171
- # ---- build points ---------------------------------------------------
186
+ # ─── build points payload ───────────────────────────────────────────
172
187
  points = [
173
188
  qdrant.PointStruct(
174
189
  id=self._generate_vector_id(),
@@ -178,7 +193,9 @@ class VectorStoreManager(BaseVectorStore):
178
193
  for txt, vec, meta in zip(texts, vectors, metadata)
179
194
  ]
180
195
 
181
- # ---- upsert with backwardcompat for old clients --------------------
196
+ # ─── upsert with backward-compat for old qdrant-client builds ───────
197
+ import inspect # keep local to avoid top-level dependency if absent elsewhere
198
+
182
199
  upsert_sig = inspect.signature(self.client.upsert)
183
200
  supports_vector_name = "vector_name" in upsert_sig.parameters
184
201
 
@@ -187,14 +204,14 @@ class VectorStoreManager(BaseVectorStore):
187
204
  "points": points,
188
205
  "wait": True,
189
206
  }
190
- if supports_vector_name:
207
+ if supports_vector_name and vector_name is not None:
191
208
  upsert_kwargs["vector_name"] = vector_name
192
209
 
193
210
  try:
194
211
  self.client.upsert(**upsert_kwargs)
195
212
  return {"status": "success", "points_inserted": len(points)}
196
213
  except Exception as exc: # noqa: BLE001
197
- log.error("Addtostore failed: %s", exc, exc_info=True)
214
+ log.error("Add-to-store failed: %s", exc, exc_info=True)
198
215
  raise VectorStoreError(f"Insertion failed: {exc}") from exc
199
216
 
200
217
  # ------------------------------------------------------------------ #
@@ -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 [] # ← NEW
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 range(len(texts)):
258
- payload = {
259
- **base_md,
260
- "chunk_index": i,
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=vector_store_id,
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
- self, vector_store_id: str, permanent: bool
323
- ) -> Dict[str, Any]:
324
- qres = self.vector_manager.delete_store(vector_store_id)
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, vector_store_id: str, file_path: str
339
- ) -> Dict[str, Any]:
340
- fres = self.vector_manager.delete_file_from_store(vector_store_id, file_path)
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.19
3
+ Version: 1.33.21
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
File without changes
File without changes
File without changes