File size: 4,118 Bytes
3c3e122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
"""
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."
)