Nahiyan14 commited on
Commit
4b5d70e
·
verified ·
1 Parent(s): 2dcdf4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -66
app.py CHANGED
@@ -112,19 +112,6 @@ st.markdown("""
112
  padding: 15px !important;
113
  border-radius: 8px !important;
114
  }
115
- .usage-metric {
116
- padding: 10px;
117
- background-color: #f8f9fa;
118
- border-radius: 8px;
119
- margin-bottom: 15px;
120
- border-left: 5px solid #4CAF50;
121
- }
122
- .usage-metric-warning {
123
- border-left: 5px solid #FFC107;
124
- }
125
- .usage-metric-danger {
126
- border-left: 5px solid #F44336;
127
- }
128
  .footer-text {
129
  font-size: 0.85rem !important;
130
  color: #7f8c8d;
@@ -154,60 +141,59 @@ with st.sidebar:
154
  st.image("https://img.icons8.com/color/96/000000/caduceus.png", width=80)
155
  st.markdown("### USMLE Step 1 Assistant")
156
  st.markdown("---")
157
-
158
- # Get user ID and remaining queries
159
- user_id = get_user_id()
160
- remaining_queries = get_remaining_queries(user_id)
161
-
162
- # Determine styling based on remaining queries
163
- status_color = "#4CAF50" # Default green for good status
164
- if remaining_queries <= 2:
165
- status_color = "#F44336" # Red for low queries
166
- elif remaining_queries <= 3:
167
- status_color = "#FFC107" # Yellow/amber for warning
168
-
169
- # Create a universally visible usage indicator
170
- st.markdown("""
171
- <style>
172
- .usage-container {
173
- border-radius: 8px;
174
- padding: 15px;
175
- margin-bottom: 20px;
176
- border-left: 5px solid var(--status-color);
177
- background-color: rgba(240, 240, 240, 0.3);
178
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
179
- }
180
- .usage-title {
181
- font-weight: 600;
182
- margin-bottom: 8px;
183
- color: #333333;
184
- }
185
- .usage-value {
186
- font-size: 1.2rem;
187
- font-weight: 700;
188
- color: #333333;
189
- }
190
- /* Dark mode specific styles */
191
- @media (prefers-color-scheme: dark) {
192
  .usage-container {
193
- background-color: rgba(70, 70, 70, 0.2);
 
 
 
 
 
194
  }
195
- .usage-title, .usage-value {
196
- color: #FFFFFF;
 
 
197
  }
198
- }
199
- </style>
200
- """, unsafe_allow_html=True)
201
-
202
- st.markdown(f"""
203
- <div class="usage-container" style="--status-color: {status_color}">
204
- <div class="usage-title">Daily Usage</div>
205
- <div class="usage-value">{remaining_queries}/{MAX_REQUESTS_PER_DAY} queries remaining</div>
206
- </div>
207
- """, unsafe_allow_html=True)
208
-
209
- # Help section in sidebar
210
- with st.sidebar:
 
 
 
 
 
 
 
 
 
 
 
 
211
  with st.expander("ℹ️ How to use"):
212
  st.markdown("""
213
  1. Type your USMLE Step 1 question in the chat input
@@ -361,9 +347,9 @@ It's designed to help with studying, but should not replace professional medical
361
  <p><strong>Performance Data</strong></p>
362
  <p>Our RAG-based system has been rigorously evaluated for accuracy and response quality.
363
  <a href="https://github.com/Nahiyan140212/MedPrepAI-RAG" target="_blank">View detailed performance metrics on GitHub</a>
364
- to learn about our testing methodology and results.</p>
365
 
366
- <p>© 2025 USMLE Step 1 Assistant - Created by Nahiyan Noor</p>
367
  </div>
368
  """, unsafe_allow_html=True)
369
 
 
112
  padding: 15px !important;
113
  border-radius: 8px !important;
114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  .footer-text {
116
  font-size: 0.85rem !important;
117
  color: #7f8c8d;
 
141
  st.image("https://img.icons8.com/color/96/000000/caduceus.png", width=80)
142
  st.markdown("### USMLE Step 1 Assistant")
143
  st.markdown("---")
144
+
145
+ # Display remaining queries with visual indicator
146
+ user_id = get_user_id()
147
+ remaining_queries = get_remaining_queries(user_id)
148
+
149
+ # Determine styling based on remaining queries
150
+ status_color = "#4CAF50" # Default green for good status
151
+ if remaining_queries <= 2:
152
+ status_color = "#F44336" # Red for low queries
153
+ elif remaining_queries <= 3:
154
+ status_color = "#FFC107" # Yellow/amber for warning
155
+
156
+ # Create a universally visible usage indicator
157
+ st.markdown("""
158
+ <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  .usage-container {
160
+ border-radius: 8px;
161
+ padding: 15px;
162
+ margin-bottom: 20px;
163
+ border-left: 5px solid var(--status-color);
164
+ background-color: rgba(240, 240, 240, 0.3);
165
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
166
  }
167
+ .usage-title {
168
+ font-weight: 600;
169
+ margin-bottom: 8px;
170
+ color: #333333;
171
  }
172
+ .usage-value {
173
+ font-size: 1.2rem;
174
+ font-weight: 700;
175
+ color: #333333;
176
+ }
177
+ /* Dark mode specific styles */
178
+ @media (prefers-color-scheme: dark) {
179
+ .usage-container {
180
+ background-color: rgba(70, 70, 70, 0.2);
181
+ }
182
+ .usage-title, .usage-value {
183
+ color: #FFFFFF;
184
+ }
185
+ }
186
+ </style>
187
+ """, unsafe_allow_html=True)
188
+
189
+ st.markdown(f"""
190
+ <div class="usage-container" style="--status-color: {status_color}">
191
+ <div class="usage-title">Daily Usage</div>
192
+ <div class="usage-value">{remaining_queries}/{MAX_REQUESTS_PER_DAY} queries remaining</div>
193
+ </div>
194
+ """, unsafe_allow_html=True)
195
+
196
+ # Help section in sidebar
197
  with st.expander("ℹ️ How to use"):
198
  st.markdown("""
199
  1. Type your USMLE Step 1 question in the chat input
 
347
  <p><strong>Performance Data</strong></p>
348
  <p>Our RAG-based system has been rigorously evaluated for accuracy and response quality.
349
  <a href="https://github.com/Nahiyan140212/MedPrepAI-RAG" target="_blank">View detailed performance metrics on GitHub</a>
350
+ to learn about our testing methodology and benchmarking results.</p>
351
 
352
+ <p>© 2025 USMLE Step 1 Assistant - Created by [Your Name]</p>
353
  </div>
354
  """, unsafe_allow_html=True)
355