From 8d74e3becb4cf740fc4fe05eb8e3935ba2a04536 Mon Sep 17 00:00:00 2001 From: "l.gabrysiak" Date: Fri, 28 Feb 2025 21:05:03 +0100 Subject: [PATCH] mod allegro --- allegro.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/allegro.py b/allegro.py index 33c3b8d..2364582 100644 --- a/allegro.py +++ b/allegro.py @@ -21,13 +21,15 @@ client = weaviate.WeaviateClient( # 2️⃣ Pobranie dokumentów z Weaviate def fetch_documents(): - query = client.query.get("Document", ["content", "fileName"]).do() + collection = client.collections.get("Documents") + response = collection.query.fetch_objects() documents = [] - for item in query["data"]["Get"]["Document"]: + for item in response["data"]["Get"]["Document"]: file_name = item.get("fileName", "unknown_file") content = item.get("content", "") if content: documents.append(f"fileName: {file_name}, content: {content}") + print(f"fileName: {file_name}") return documents documents = fetch_documents()