From 0ca54f429e72fa4523a8d2a1182a4a9c48a6b8f4 Mon Sep 17 00:00:00 2001 From: Lars Date: Sat, 8 Nov 2025 15:56:13 +0100 Subject: [PATCH] Dateien nach "scripts" hochladen --- scripts/import_markdown.py | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/scripts/import_markdown.py b/scripts/import_markdown.py index ed86ae1..067499b 100644 --- a/scripts/import_markdown.py +++ b/scripts/import_markdown.py @@ -122,6 +122,51 @@ except Exception: # 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]: out: List[str] = [] for dirpath, _, filenames in os.walk(root):