Spaces:
Paused
Paused
| # config.py | |
| import os | |
| from dotenv import load_dotenv | |
| # Load environment variables from .env file if it exists (for local development) | |
| # In Hugging Face Spaces, GOOGLE_API_KEY will be set via Secrets. | |
| load_dotenv() | |
| # API Keys and Model Configuration | |
| GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY") | |
| EMBEDDING_MODEL = "models/embedding-001" | |
| GENERATIVE_MODEL = "gemini-1.5-flash-latest" # Or "gemini-pro" or other preferred model | |
| # Database Paths | |
| # These paths are relative to the WORKDIR defined in Dockerfile (i.e., /app) | |
| # Hugging Face Spaces persistent storage will store data created at these paths. | |
| CHROMA_DB_PATH = "./chroma_db" # Will be /app/chroma_db inside the container | |
| STUDENT_DB_PATH = "./students.db" # Will be /app/students.db inside the container | |
| RAG_COLLECTION_NAME = "chat_records_v2" # Changed name to avoid conflicts if old data exists | |
| # Ensure API key is available (especially for local runs, HF handles missing secrets with errors) | |
| # if not GOOGLE_API_KEY: | |
| # print("Warning: GOOGLE_API_KEY not found. Please set it in your environment or .env file.") | |
| # For HF deployment, if secret is not set, the app might fail at runtime when API is called. |