fionasu commited on
Commit
5ce6948
Β·
verified Β·
1 Parent(s): 4064d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -127,9 +127,9 @@ def respond(message, history, use_spanish, chatbot_mode, destinations, season, l
127
  chatbot_purpose = f"Chatbot Mode: {', '.join(chatbot_mode)}"
128
  print(chatbot_purpose)
129
 
130
- if "Packing" in chatbot_mode:
131
  messages = [{"role": "system", "content": f"You're a friendly and gen z chatbot. Base your response on the provided context: {top_weather} and {top_luggage}."}]
132
- elif "Food/Attractions" in chatbot_mode:
133
  messages = [{"role": "system", "content": f"You're a friendly and gen z chatbot. Base your response on the provided context: {top_food} and {top_attraction}."}]
134
 
135
  # if history:
@@ -165,10 +165,9 @@ with gr.Blocks() as demo:
165
  # ─── left column: your controls ───
166
  with gr.Column(scale=1):
167
  use_spanish = gr.Checkbox(label="Use Spanish", value=False)
168
- gr.Markdown("### What do you need help with?")
169
- chatbot_mode = gr.CheckboxGroup(
170
- choices=["Packing","Food/Attractions"],
171
- label=None
172
  )
173
  gr.Markdown("### Where are you going?")
174
  destinations = gr.CheckboxGroup(
 
127
  chatbot_purpose = f"Chatbot Mode: {', '.join(chatbot_mode)}"
128
  print(chatbot_purpose)
129
 
130
+ if chatbot_mode == "Packing":
131
  messages = [{"role": "system", "content": f"You're a friendly and gen z chatbot. Base your response on the provided context: {top_weather} and {top_luggage}."}]
132
+ elif chatbot_mode == "Food/Attractions":
133
  messages = [{"role": "system", "content": f"You're a friendly and gen z chatbot. Base your response on the provided context: {top_food} and {top_attraction}."}]
134
 
135
  # if history:
 
165
  # ─── left column: your controls ───
166
  with gr.Column(scale=1):
167
  use_spanish = gr.Checkbox(label="Use Spanish", value=False)
168
+ chatbot_mode = gr.Radio(
169
+ choices=["Packing", "Food/Attractions"],
170
+ label="What do you need help with?"
 
171
  )
172
  gr.Markdown("### Where are you going?")
173
  destinations = gr.CheckboxGroup(