Spaces:
Sleeping
Sleeping
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 |