Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -164,6 +164,9 @@ custom_css = """
|
|
164 |
font-family: 'Arial', sans-serif;
|
165 |
height: 400px;
|
166 |
overflow-y: auto;
|
|
|
|
|
|
|
167 |
}
|
168 |
.gr-button {
|
169 |
background-color: #4CAF50 !important;
|
@@ -193,12 +196,83 @@ h1 {
|
|
193 |
margin: auto;
|
194 |
padding: 20px;
|
195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
"""
|
197 |
|
198 |
with gr.Blocks(css=custom_css, title=f"{BUSINESS_CONFIG['name']} Support") as demo:
|
199 |
with gr.Column(elem_id="container"):
|
200 |
gr.Markdown(f"# π€ {BUSINESS_CONFIG['name']} Support Chat")
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
with gr.Row():
|
204 |
with gr.Column(scale=2):
|
@@ -232,17 +306,9 @@ with gr.Blocks(css=custom_css, title=f"{BUSINESS_CONFIG['name']} Support") as de
|
|
232 |
["What payment methods do you accept?"]
|
233 |
],
|
234 |
inputs=msg,
|
235 |
-
label="Click any question to try it!"
|
|
|
236 |
)
|
237 |
-
|
238 |
-
gr.Markdown("### πͺ Store Information")
|
239 |
-
gr.Markdown(f"""
|
240 |
-
- **Hours**: {BUSINESS_CONFIG['hours']}
|
241 |
-
- **Address**: {BUSINESS_CONFIG['address']}
|
242 |
-
- **Phone**: {BUSINESS_CONFIG['phone']}
|
243 |
-
- **Email**: {BUSINESS_CONFIG['email']}
|
244 |
-
- **Shipping**: {BUSINESS_CONFIG['shipping']}
|
245 |
-
""")
|
246 |
|
247 |
# Event handlers
|
248 |
msg.submit(chat_with_bot, [msg, chatbot], [msg, chatbot])
|
|
|
164 |
font-family: 'Arial', sans-serif;
|
165 |
height: 400px;
|
166 |
overflow-y: auto;
|
167 |
+
border: 1px solid #e0e0e0;
|
168 |
+
border-radius: 8px;
|
169 |
+
padding: 15px;
|
170 |
}
|
171 |
.gr-button {
|
172 |
background-color: #4CAF50 !important;
|
|
|
196 |
margin: auto;
|
197 |
padding: 20px;
|
198 |
}
|
199 |
+
.info-panel {
|
200 |
+
background-color: #f8f9fa;
|
201 |
+
border-radius: 8px;
|
202 |
+
padding: 15px;
|
203 |
+
margin-bottom: 20px;
|
204 |
+
border-left: 4px solid #2196F3;
|
205 |
+
}
|
206 |
+
.info-header {
|
207 |
+
color: #2C3E50;
|
208 |
+
font-weight: bold;
|
209 |
+
margin-bottom: 10px;
|
210 |
+
display: flex;
|
211 |
+
align-items: center;
|
212 |
+
}
|
213 |
+
.info-header i {
|
214 |
+
margin-right: 8px;
|
215 |
+
font-size: 18px;
|
216 |
+
}
|
217 |
+
.info-content {
|
218 |
+
margin-left: 26px;
|
219 |
+
}
|
220 |
+
.example-btn {
|
221 |
+
margin-bottom: 5px;
|
222 |
+
}
|
223 |
"""
|
224 |
|
225 |
with gr.Blocks(css=custom_css, title=f"{BUSINESS_CONFIG['name']} Support") as demo:
|
226 |
with gr.Column(elem_id="container"):
|
227 |
gr.Markdown(f"# π€ {BUSINESS_CONFIG['name']} Support Chat")
|
228 |
+
|
229 |
+
# Information panel with abilities, limitations, and usage instructions
|
230 |
+
with gr.Row():
|
231 |
+
with gr.Column(scale=3):
|
232 |
+
with gr.Box(elem_classes="info-panel"):
|
233 |
+
gr.Markdown("""
|
234 |
+
<div class="info-header"><i>π‘</i> How to Use This Chatbot</div>
|
235 |
+
<div class="info-content">
|
236 |
+
This AI assistant can help you with product information, store policies, technical support, and more.
|
237 |
+
Just type your question in the chat box or click on any of the example questions to get started.
|
238 |
+
</div>
|
239 |
+
""")
|
240 |
+
|
241 |
+
with gr.Box(elem_classes="info-panel"):
|
242 |
+
gr.Markdown("""
|
243 |
+
<div class="info-header"><i>β
</i> What I Can Help With</div>
|
244 |
+
<div class="info-content">
|
245 |
+
β’ Product information, specifications, and pricing<br>
|
246 |
+
β’ Store hours, location, and contact information<br>
|
247 |
+
β’ Shipping options and return policies<br>
|
248 |
+
β’ Technical support and troubleshooting<br>
|
249 |
+
β’ Product comparisons and recommendations<br>
|
250 |
+
β’ Service information and repair options
|
251 |
+
</div>
|
252 |
+
""")
|
253 |
+
|
254 |
+
with gr.Box(elem_classes="info-panel"):
|
255 |
+
gr.Markdown("""
|
256 |
+
<div class="info-header"><i>β οΈ</i> Limitations</div>
|
257 |
+
<div class="info-content">
|
258 |
+
β’ I can't process orders or payments directly<br>
|
259 |
+
β’ I don't have access to your personal account information<br>
|
260 |
+
β’ For complex issues, I may connect you with a human specialist<br>
|
261 |
+
β’ My knowledge is based on information available up to my last training
|
262 |
+
</div>
|
263 |
+
""")
|
264 |
+
|
265 |
+
with gr.Column(scale=2):
|
266 |
+
gr.Markdown("### πͺ Store Information")
|
267 |
+
gr.Markdown(f"""
|
268 |
+
**Hours**: {BUSINESS_CONFIG['hours']}
|
269 |
+
**Address**: {BUSINESS_CONFIG['address']}
|
270 |
+
**Phone**: {BUSINESS_CONFIG['phone']}
|
271 |
+
**Email**: {BUSINESS_CONFIG['email']}
|
272 |
+
**Shipping**: {BUSINESS_CONFIG['shipping']}
|
273 |
+
""")
|
274 |
+
|
275 |
+
gr.Markdown("---")
|
276 |
|
277 |
with gr.Row():
|
278 |
with gr.Column(scale=2):
|
|
|
306 |
["What payment methods do you accept?"]
|
307 |
],
|
308 |
inputs=msg,
|
309 |
+
label="Click any question to try it!",
|
310 |
+
examples_per_page=7
|
311 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
|
313 |
# Event handlers
|
314 |
msg.submit(chat_with_bot, [msg, chatbot], [msg, chatbot])
|