arpit13 commited on
Commit
90074c8
·
verified ·
1 Parent(s): 8df15f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -37,16 +37,18 @@ def chatbot(user_input, category, history=[]):
37
  history.append((user_input, bot_response))
38
  return history, history
39
 
40
- # Gradio Interface setup
41
  chat_interface = gr.Interface(
42
  fn=chatbot,
43
  inputs=[
44
- "text", # User input
45
- gr.Dropdown(choices=["Stress Management", "Career Advice", "General", "Friendly Buddy"], label="Choose Chat Category"), # Category selection
 
 
46
  "state" # History
47
  ],
48
  outputs=["chatbot", "state"],
49
- live=False,
50
  title="Meet your Personal Assistant: Your Helpful and Caring Chatbot",
51
  description="This chatbot is here to help you with anything you need, whether it’s answering questions, offering support, or guiding you through tasks. With a friendly and empathetic approach, it listens carefully to your concerns and provides thoughtful, understanding responses. Whether you’re seeking information or just someone to chat with, our chatbot is designed to make you feel heard and supported. It’s more than just a tool—it’s a companion dedicated to making your day easier and more enjoyable."
52
  )
 
37
  history.append((user_input, bot_response))
38
  return history, history
39
 
40
+ # Gradio Interface setup with a vertical layout for category
41
  chat_interface = gr.Interface(
42
  fn=chatbot,
43
  inputs=[
44
+ gr.Column([ # Wrap inputs in a vertical column
45
+ gr.Dropdown(choices=["Stress Management", "Career Advice", "General", "Friendly Buddy"], label="Choose Chat Category"),
46
+ gr.Textbox(label="Your Message") # Add text input below the category dropdown
47
+ ]),
48
  "state" # History
49
  ],
50
  outputs=["chatbot", "state"],
51
+ live=True,
52
  title="Meet your Personal Assistant: Your Helpful and Caring Chatbot",
53
  description="This chatbot is here to help you with anything you need, whether it’s answering questions, offering support, or guiding you through tasks. With a friendly and empathetic approach, it listens carefully to your concerns and provides thoughtful, understanding responses. Whether you’re seeking information or just someone to chat with, our chatbot is designed to make you feel heard and supported. It’s more than just a tool—it’s a companion dedicated to making your day easier and more enjoyable."
54
  )