Доработка: 1. В vectorstore.py заменить импорт Ollama на from langchain
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from vectorstore import create_vectorstore, load_documents
|
||||
|
||||
def main():
|
||||
load_dotenv() # загружаем TAVILY_API_KEY и другие переменные
|
||||
persist_dir = os.getenv("CHROMA_PERSIST_DIR", "./chroma_db")
|
||||
vectorstore = create_vectorstore(persist_directory=persist_dir)
|
||||
docs_dir = os.path.join(os.path.dirname(__file__), "documents")
|
||||
if not os.path.isdir(docs_dir):
|
||||
print(f"Каталог {docs_dir} не найден.")
|
||||
return
|
||||
print(f"Загрузка документов из {docs_dir} в ChromaDB ({persist_dir})...")
|
||||
load_documents(docs_dir, vectorstore)
|
||||
print("Загрузка завершена.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user