projectdavid 1.33.21__py3-none-any.whl → 1.33.22__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.

@@ -7,10 +7,8 @@ details from the higher‑level SDK.
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- import inspect
11
10
  import time
12
11
  import uuid
13
- from pathlib import Path
14
12
  from typing import Any, Dict, List, Optional
15
13
 
16
14
  from dotenv import load_dotenv
@@ -57,12 +55,14 @@ class VectorStoreManager(BaseVectorStore):
57
55
  vectors_config: Optional[Dict[str, qdrant.VectorParams]] = None,
58
56
  ) -> dict:
59
57
  """
60
- Create or recreate a Qdrant collection. By default creates a single-vector
61
- collection with `vector_size`. To define multi-vector schema, pass
62
- `vectors_config` mapping field names to VectorParams.
58
+ Create or recreate a Qdrant collection.
59
+
60
+ • If *vectors_config* is provided use it verbatim (multi-vector schema).
61
+ • Otherwise create a classic single-vector collection *without* naming the
62
+ vector field – so upserts can omit ``vector_name``.
63
63
  """
64
64
  try:
65
- # existence check
65
+ # ── pre-existence check ────────────────────────────────────────────
66
66
  if any(
67
67
  col.name == collection_name
68
68
  for col in self.client.get_collections().collections
@@ -73,27 +73,32 @@ class VectorStoreManager(BaseVectorStore):
73
73
  if dist not in qdrant.Distance.__members__:
74
74
  raise ValueError(f"Invalid distance metric '{distance}'")
75
75
 
76
- # choose schema
77
- if vectors_config:
78
- config = vectors_config
79
- else:
80
- config = {
81
- "_default": qdrant.VectorParams(
82
- size=vector_size, distance=qdrant.Distance[dist]
83
- )
84
- }
76
+ # ── choose schema ──────────────────────────────────────────────────
77
+ if vectors_config: # caller supplied full mapping
78
+ config = vectors_config # e.g. {"text_vec": ..., "img_vec": ...}
79
+ else: # default = single unnamed vector
80
+ config = qdrant.VectorParams(
81
+ size=vector_size,
82
+ distance=qdrant.Distance[dist],
83
+ )
85
84
 
86
- # recreate with full schema
85
+ # ── (re)create collection ─────────────────────────────────────────
87
86
  self.client.recreate_collection(
88
87
  collection_name=collection_name,
89
88
  vectors_config=config,
90
89
  )
91
- # record metadata for each field
90
+
91
+ # ── bookkeeping ───────────────────────────────────────────────────
92
+ if isinstance(config, dict):
93
+ fields = list(config.keys())
94
+ else: # unnamed field
95
+ fields = [None]
96
+
92
97
  self.active_stores[collection_name] = {
93
98
  "created_at": int(time.time()),
94
99
  "vector_size": vector_size,
95
100
  "distance": dist,
96
- "fields": list(config.keys()),
101
+ "fields": fields,
97
102
  }
98
103
  log.info("Created Qdrant collection %s", collection_name)
99
104
  return {"collection_name": collection_name, "status": "created"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid
3
- Version: 1.33.21
3
+ Version: 1.33.22
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
@@ -20,7 +20,7 @@ projectdavid/clients/synchronous_inference_wrapper.py,sha256=qh94rtNlLqgIxiA_ZbQ
20
20
  projectdavid/clients/threads_client.py,sha256=ekzU5w14zftmtmFkiec3NC90Of-_KVSUY1qH9cmfSFg,6771
21
21
  projectdavid/clients/tools_client.py,sha256=GkCVOmwpAoPqVt6aYmH0G1HIFha3iEwR9IIf9teR0j8,11487
22
22
  projectdavid/clients/users_client.py,sha256=eCuUb9qvyH1GUFhZu6TRL9zdoK-qzHSs8-Vmrk_0mmg,13729
23
- projectdavid/clients/vector_store_manager.py,sha256=fkZAL5BjgU8-O5snpKLOJ_7HIzAK2goM2cF2KqwaCQQ,15137
23
+ projectdavid/clients/vector_store_manager.py,sha256=A-L1rhURKwiRs0EDd1HOuIShOtaC9Hb1yHB4He456Zc,15943
24
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
@@ -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.21.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
41
- projectdavid-1.33.21.dist-info/METADATA,sha256=2owgbc2e6nKSPMtJwj9QSjF3VgYTJFA79ibuxQzw-UQ,11555
42
- projectdavid-1.33.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- projectdavid-1.33.21.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
44
- projectdavid-1.33.21.dist-info/RECORD,,
40
+ projectdavid-1.33.22.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
41
+ projectdavid-1.33.22.dist-info/METADATA,sha256=Q4TM1PmVUXpccxOLaRrKnx2qwZw48w7nt-XUOlUiJaE,11555
42
+ projectdavid-1.33.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ projectdavid-1.33.22.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
44
+ projectdavid-1.33.22.dist-info/RECORD,,