""" Insta-AutoApp Configuration All constants and configuration values for the application. """ import os from dotenv import load_dotenv load_dotenv() # ============================================================================= # API Configuration # ============================================================================= HF_API_TOKEN = os.getenv("HF_API_TOKEN", "") HF_MODEL_ID = os.getenv("HF_MODEL_ID", "Qwen/Qwen2.5-72B-Instruct") HF_API_URL = f"https://api-inference.huggingface.co/models/{HF_MODEL_ID}" # ============================================================================= # Retrieval Configuration # ============================================================================= TOP_K = int(os.getenv("TOP_K", "5")) EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2" CHUNK_SIZE = 500 # tokens CHUNK_OVERLAP = 50 # tokens # ============================================================================= # FAISS Index Paths # ============================================================================= FAISS_INDEX_PATH = "data/index.faiss" FAISS_DOCSTORE_PATH = "data/index.pkl" # ============================================================================= # API Retry Configuration # ============================================================================= MAX_RETRIES = 3 # Total attempts (1 initial + 2 retries) RETRY_DELAY = 2.5 # Seconds between retries REQUEST_TIMEOUT = 30 # Seconds # ============================================================================= # Vehicle Profile Options (2023 Ford Bronco configurations only) # ============================================================================= TRIM_OPTIONS = [ "Base", "Big Bend", "Black Diamond", "Badlands", "Outer Banks", "Wildtrak", "Raptor" ] ENGINE_OPTIONS = [ "2.3L EcoBoost", "2.7L EcoBoost" ] PACKAGE_OPTIONS = [ "None", "Sasquatch", "Lux", "Sasquatch + Lux" ] TOP_TYPE_OPTIONS = [ "Soft Top", "Hard Top", "Modular Top" ] MILEAGE_MIN = 0 MILEAGE_MAX = 300000 MILEAGE_DEFAULT = 0 # ============================================================================= # Urgency Levels # ============================================================================= URGENCY_LEVELS = [ "Safe", # Cosmetic or informational only "Monitor", # Non-critical, check within 7 days "Urgent", # Schedule service soon, limit driving "Do Not Drive" # Safety-critical, stop immediately ] # Safety-critical categories that default to conservative urgency SAFETY_CRITICAL_KEYWORDS = [ "brake", "braking", "stopping", "steering", "steer", "overheat", "overheating", "temperature", "drivetrain", "transmission", "4x4", "4wd" ] # ============================================================================= # Fallback Follow-up Questions (used when LLM call fails) # ============================================================================= FALLBACK_FOLLOWUP_QUESTIONS = [ "What driving mode were you in when this occurred? (2H, 4H, 4L, or a GOAT mode)", "Approximately how long has this symptom been occurring?" ] # ============================================================================= # UI Configuration # ============================================================================= APP_TITLE = "Insta-AutoApp" APP_DESCRIPTION = "AI-Powered Symptom Triage for 2023 Ford Bronco" DISCLAIMER_BANNER = ( "⚠️ Insta-AutoApp provides triage guidance only, not professional mechanical diagnosis. " "Always consult a Ford-certified mechanic for safety-critical issues." ) DISCLAIMER_RESPONSE = ( "DISCLAIMER: This is triage guidance only, not a professional mechanical diagnosis. " "For safety-critical issues, consult a Ford-certified mechanic." ) ERROR_API_UNAVAILABLE = ( "The AI triage service is temporarily unavailable. " "Please try again in a few minutes." ) ERROR_NOT_IN_MANUAL = ( "This issue is not clearly covered in the OEM manual. " "For your safety, we recommend contacting a Ford dealer or certified mechanic for inspection." )