From ee4937855b42dd860afa3bfd8e98c6d4311baebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B8=D0=BD=D0=B0=D1=80=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D1=82=D0=BE=D0=B2?= Date: Wed, 17 Jun 2026 18:05:24 +0000 Subject: [PATCH] vectorstore.py updated: update vectorstore.py --- vectorstore.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vectorstore.py b/vectorstore.py index eba9eb1..ff41888 100644 --- a/vectorstore.py +++ b/vectorstore.py @@ -1,8 +1,8 @@ from pathlib import Path from uuid import uuid4 -import chromadb -from chromadb.config import Settings +from langchain_chroma import Chroma, Settings + from langchain_ollama import OllamaEmbeddings from langchain_core.documents import Document from langchain_text_splitters import RecursiveCharacterTextSplitter @@ -14,12 +14,12 @@ OLLAMA_BASE_URL = "http://127.0.0.1:11434" def create_vectorstore(persist_directory: str = CHROMA_DIR): - client = chromadb.Client(Settings(persist_directory=persist_directory)) + client = Chroma(Settings(persist_directory=persist_directory)) collection = client.get_or_create_collection(name=COLLECTION_NAME) return collection -def load_documents(directory: str, vectorstore: chromadb.Collection) -> int: +def load_documents(directory: str, vectorstore: Chroma) -> int: splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200,