Удалить init_documents.py

This commit is contained in:
2026-05-28 13:32:43 +00:00
parent 36bd2c4af0
commit 6c1ddf8bdd
-20
View File
@@ -1,20 +0,0 @@
"""
Script to load all .txt files from a directory into the vector store.
"""
import os
from pathlib import Path
from chunker import load_and_split
from vector_store import vector_store
if __name__ == "__main__":
docs_dir = Path("docs")
if not docs_dir.exists():
print("Docs directory not found.")
exit(1)
chunks = load_and_split(docs_dir)
# Each chunk is (text, metadata)
documents = []
for idx, (chunk, meta) in enumerate(chunks):
documents.append({"content": chunk, "metadata": meta})
vector_store.add_documents(documents)
print(f"Loaded {len(documents)} chunks into the vector store.")