innoSageAgentOne / app /vector_store /initialize_chroma_db.py
Asaad Almutareb
cleaned branch, added final streaming callback handler
fa99d8f
raw
history blame
626 Bytes
from langchain_community.vectorstores import Chroma
from app.core.config import settings
import chromadb
#import dotenv
#import os
#dotenv.load_dotenv()
#persist_directory = os.getenv('VECTOR_DATABASE_LOCATION')
persist_directory = settings.VECTOR_DATABASE_LOCATION
def initialize_chroma_db() -> Chroma:
#collection_name = os.getenv('CONVERSATION_COLLECTION_NAME')
collection_name = settings.CONVERSATION_COLLECTION_NAME
client = chromadb.PersistentClient(
path=persist_directory
)
collection = client.get_or_create_collection(
name=collection_name,
)
return collection