Moving chromadb to env var

This commit is contained in:
2025-07-30 20:27:03 -04:00
parent 0a88a03c90
commit c7152d3f32

View File

@@ -1,4 +1,5 @@
import logging
import os
import argparse
import chromadb
@@ -11,7 +12,9 @@ from chunker import Chunker
from dotenv import load_dotenv
client = chromadb.PersistentClient(path="/Users/ryanchen/Programs/raggr/chromadb")
load_dotenv()
client = chromadb.PersistentClient(path=os.getenv("CHROMADB_PATH", ""))
simba_docs = client.get_or_create_collection(name="simba_docs")
feline_vet_lookup = client.get_or_create_collection(name="feline_vet_lookup")
@@ -24,8 +27,6 @@ parser.add_argument(
"--reindex", action="store_true", help="re-index the simba documents"
)
load_dotenv()
def chunk_data(texts: list[str], collection):
# Step 2: Create chunks