mod allegro
This commit is contained in:
parent
4a264e38eb
commit
8d74e3becb
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue