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()