chatbot-gitconnect / app /config.py
quantumbit's picture
rag value updates
25f29e5
import os
from pathlib import Path
from dotenv import load_dotenv
# Load both potential env file locations.
_APP_DIR = Path(__file__).resolve().parent
_ROOT_ENV = _APP_DIR.parent / ".env"
_APP_ENV = _APP_DIR / ".env"
load_dotenv(dotenv_path=_ROOT_ENV, override=False)
load_dotenv(dotenv_path=_APP_ENV, override=True)
class Settings:
gemini_api_key: str = os.getenv("GEMINI_API_KEY", "")
embedding_model_name: str = os.getenv(
"EMBEDDING_MODEL_NAME",
"sentence-transformers/all-MiniLM-L6-v2",
)
student_performance_url_template: str = os.getenv(
"STUDENT_PERFORMANCE_URL_TEMPLATE",
"https://git-connect-backend-v2.vercel.app/api/student/{student_id}/performance/{semester}",
)
rag_index_db_url: str = os.getenv("RAG_INDEX_DB_URL", "")
neon_max_retries: int = int(os.getenv("NEON_MAX_RETRIES", "5"))
neon_retry_backoff_sec: float = float(os.getenv("NEON_RETRY_BACKOFF_SEC", "1.0"))
neon_connect_timeout_sec: int = int(os.getenv("NEON_CONNECT_TIMEOUT_SEC", "10"))
vector_data_dir: str = os.getenv("VECTOR_DATA_DIR", "data/vector_index")
raw_text_dir: str = os.getenv("RAW_TEXT_DIR", "data/raw_text")
gemini_model: str = os.getenv("GEMINI_MODEL", "gemini-2.5-flash")
pdf_timeout_sec: int = int(os.getenv("PDF_TIMEOUT_SEC", "60"))
pdf_max_retries: int = int(os.getenv("PDF_MAX_RETRIES", "3"))
pdf_retry_backoff_sec: float = float(os.getenv("PDF_RETRY_BACKOFF_SEC", "1.5"))
rag_chunk_size: int = int(os.getenv("RAG_CHUNK_SIZE", "1400"))
rag_chunk_overlap: int = int(os.getenv("RAG_CHUNK_OVERLAP", "250"))
rag_syllabus_top_k: int = int(os.getenv("RAG_SYLLABUS_TOP_K", "8"))
settings = Settings()