This commit is contained in:
1 parent
6c62f64784
commit
0ca54f429e
1 file changed
+45
@@ -122,6 +122,51 @@ except Exception:
|
|||||||
# Helper
|
# Helper
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Compatibility wrappers for legacy qdrant helpers
|
||||||
|
def _ensure_collections_compat(client, cfg, dim):
|
||||||
|
"""
|
||||||
|
Call ensure_collections with the correct signature across releases:
|
||||||
|
- preferred: ensure_collections(client, cfg)
|
||||||
|
- fallbacks: (client, cfg.prefix, dim) -> (client, cfg.prefix) -> (client)
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return ensure_collections(client, cfg)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
return ensure_collections(client, cfg.prefix, dim)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
return ensure_collections(client, cfg.prefix)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
return ensure_collections(client)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
# If everything fails, do nothing
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _ensure_payload_indexes_compat(client, cfg):
|
||||||
|
"""
|
||||||
|
Try calling payload index creation with cfg, then prefix; ignore if unsupported.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
_ensure_payload_indexes(client, cfg)
|
||||||
|
return
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
_ensure_payload_indexes(client, cfg.prefix)
|
||||||
|
return
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
# final no-op
|
||||||
|
return
|
||||||
|
|
||||||
def iter_md(root: str) -> List[str]:
|
def iter_md(root: str) -> List[str]:
|
||||||
out: List[str] = []
|
out: List[str] = []
|
||||||
for dirpath, _, filenames in os.walk(root):
|
for dirpath, _, filenames in os.walk(root):
|
||||||
|
|||||||
Reference in new issue
Block a user