drbinna commited on
Commit
099c756
Β·
verified Β·
1 Parent(s): 2f966e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -9
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
- iface = gr.Interface(
21
- fn=chatbot_response,
22
- inputs=gr.Textbox(placeholder="Ask me about the SmartHome Hub Pro..."),
23
- outputs="text",
24
- title="Tech Gadget Chatbot",
25
- description="Ask about product features, returns, or shipping."
26
- )
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  if __name__ == "__main__":
29
- iface.launch()
 
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()