DemoChatBot / config.py
OnlyTheTruth03's picture
Initial Commit
721ca73 verified
"""
config.py
─────────
Central configuration for the AstroBot RAG application.
All tuneable parameters live here β€” change once, affects everywhere.
"""
import os
from dataclasses import dataclass, field
@dataclass
class AppConfig:
# ── Groq LLM ──────────────────────────────────────────────────────────────
groq_api_key: str = field(default_factory=lambda: os.environ.get("GROQ_API_KEY", ""))
groq_model: str = "llama-3.1-8b-instant"
groq_temperature: float = 0.2
groq_max_tokens: int = 1024
# ── Hugging Face Dataset ───────────────────────────────────────────────────
hf_dataset: str = field(default_factory=lambda: os.environ.get("HF_DATASET", ""))
hf_token: str = field(default_factory=lambda: os.environ.get("HF_TOKEN", ""))
dataset_split: str = "train"
# Ordered list of candidate column names that hold the raw text
text_column_candidates: list = field(default_factory=lambda: [
"text", "content", "body", "page_content", "extracted_text"
])
# ── Embeddings & Retrieval ─────────────────────────────────────────────────
embed_model: str = "sentence-transformers/all-MiniLM-L6-v2"
chunk_size: int = 512
chunk_overlap: int = 64
top_k: int = 5
# ── App Meta ───────────────────────────────────────────────────────────────
app_title: str = "πŸ”­ AstroBot β€” Astrology Learning Assistant"
app_description: str = (
"Ask me anything about astrology concepts β€” planets, houses, aspects, "
"signs, transits, chart reading, and more. "
"**Note:** This bot explains concepts only; no personal predictions are made."
)
# Singleton β€” import this everywhere
cfg = AppConfig()