Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
# Simple rule-based chatbot logic
|
| 4 |
def chatbot_response(message):
|
| 5 |
message = message.lower()
|
| 6 |
|
|
@@ -17,13 +17,24 @@ def chatbot_response(message):
|
|
| 17 |
else:
|
| 18 |
return "I'm not sure how to help with that. Can you ask about shipping, returns, or the product?"
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
if __name__ == "__main__":
|
| 29 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# ✅ Simple rule-based chatbot logic
|
| 4 |
def chatbot_response(message):
|
| 5 |
message = message.lower()
|
| 6 |
|
|
|
|
| 17 |
else:
|
| 18 |
return "I'm not sure how to help with that. Can you ask about shipping, returns, or the product?"
|
| 19 |
|
| 20 |
+
# ✅ Usage instructions for testers
|
| 21 |
+
instructions = """
|
| 22 |
+
### 💡 How to Use the Chatbot:
|
| 23 |
+
Ask about:
|
| 24 |
+
- **Shipping** — "When will my order arrive?"
|
| 25 |
+
- **Returns** — "How do I return the product?"
|
| 26 |
+
- **Product details** — "What does the SmartHome Hub Pro do?"
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
with gr.Blocks() as demo:
|
| 30 |
+
gr.Markdown(instructions)
|
| 31 |
+
gr.Interface(
|
| 32 |
+
fn=chatbot_response,
|
| 33 |
+
inputs=gr.Textbox(placeholder="Ask me about the SmartHome Hub Pro..."),
|
| 34 |
+
outputs="text",
|
| 35 |
+
title="Tech Gadget Chatbot",
|
| 36 |
+
description="Ask about product features, returns, or shipping."
|
| 37 |
+
)
|
| 38 |
|
| 39 |
if __name__ == "__main__":
|
| 40 |
+
demo.launch()
|