-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
105 lines (83 loc) · 2.81 KB
/
app.py
File metadata and controls
105 lines (83 loc) · 2.81 KB
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
import streamlit as st
st.set_page_config(page_title="Safety & Feedback Portal",layout="wide")
# Import after page config
import complaint_bot
import feedback_bot
st.sidebar.title("Navigation")
app_mode = st.sidebar.radio(
"Select a service:",
["Home", "Report Safety Issue", "Provide Feedback"],
index=0
)
# Clear state when switching modes
if "current_mode" not in st.session_state:
st.session_state.current_mode = app_mode
elif st.session_state.current_mode != app_mode:
# User switched modes - clear relevant state
keys_to_clear = [
"messages", "record", "remaining", "attempt_counts", "completed",
"no_extraction_count", "last_extracted_count",
"fb_messages", "fb_record", "fb_remaining", "fb_attempt_counts", "fb_completed"
]
for key in keys_to_clear:
if key in st.session_state:
del st.session_state[key]
st.session_state.current_mode = app_mode
# --- HOME PAGE ---
if app_mode == "Home":
st.title("Vehicle Safety and Feedback Portal")
col1, col2 = st.columns(2)
with col1:
st.markdown("""
### Report Safety Issue
File a formal safety complaint about:
- Vehicle defects
- Safety concerns
- Recalls or incidents
- Component failures
**Our AI assistant will guide you through:**
- Vehicle identification
- Incident details
- Location and timing
- Safety impact assessment
""")
st.info("**Tip:** You can provide all details at once or step-by-step!")
with col2:
st.markdown("""
### Provide Feedback
Share your thoughts about:
- Our services
- Product quality
- Website experience
- Suggestions for improvement
**We value your input on:**
- Customer service
- Process improvements
- Feature requests
- General comments
""")
st.info("**Tip:** Your feedback helps us improve!")
st.markdown("---")
# Quick stats
st.markdown("### Why Report?")
col_a, col_b, col_c = st.columns(3)
with col_a:
st.metric("Response Time", "1-2 Days", "Fast")
with col_b:
st.metric("Privacy", "100%", "Secure")
with col_c:
st.metric("AI Assisted", "Smart", "Easy")
st.markdown("---")
st.markdown("""
<div style='text-align: center; color: #666;'>
<p>Your information is secure and confidential</p>
<p>You'll receive confirmation via email</p>
<p>Our AI makes reporting fast and easy</p>
</div>
""", unsafe_allow_html=True)
# --- COMPLAINT BOT ---
elif app_mode == "Report Safety Issue":
complaint_bot.run()
# --- FEEDBACK BOT ---
elif app_mode == "Provide Feedback":
feedback_bot.run()