Spaces:
Sleeping
Sleeping
tried to add chatbot mode
Browse files
app.py
CHANGED
|
@@ -124,6 +124,10 @@ def respond(message, history,use_spanish, destinations, season, luggage_types, l
|
|
| 124 |
f"Food: {', '.join(food_prefs)}\n"
|
| 125 |
)
|
| 126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
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}."}]
|
| 128 |
|
| 129 |
if history:
|
|
@@ -149,24 +153,29 @@ with gr.Blocks() as demo:
|
|
| 149 |
# βββ left column: your controls βββ
|
| 150 |
with gr.Column(scale=1):
|
| 151 |
use_spanish = gr.Checkbox(label="Use Spanish", value=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
gr.Markdown("### Where are you going?")
|
| 153 |
destinations = gr.CheckboxGroup(
|
| 154 |
choices=["San Francisco","Los Angeles"],
|
| 155 |
label=None
|
| 156 |
)
|
| 157 |
-
gr.Markdown("###
|
| 158 |
season = gr.CheckboxGroup(
|
| 159 |
choices=["Warm/Dry","Cool/Wet"],
|
| 160 |
label=None
|
| 161 |
)
|
| 162 |
-
gr.Markdown("###
|
| 163 |
luggage_types = gr.CheckboxGroup(
|
| 164 |
choices=["Carry-on","Checked"],
|
| 165 |
label="Type"
|
| 166 |
)
|
| 167 |
luggage_size = gr.Slider(
|
| 168 |
minimum=10, maximum=100, step=10, value=20,
|
| 169 |
-
label="
|
| 170 |
)
|
| 171 |
gr.Markdown("### Food preferences")
|
| 172 |
food_prefs = gr.CheckboxGroup(
|
|
@@ -197,6 +206,7 @@ with gr.Blocks() as demo:
|
|
| 197 |
msg,
|
| 198 |
chat_box,
|
| 199 |
use_spanish,
|
|
|
|
| 200 |
destinations,
|
| 201 |
season,
|
| 202 |
luggage_types,
|
|
|
|
| 124 |
f"Food: {', '.join(food_prefs)}\n"
|
| 125 |
)
|
| 126 |
|
| 127 |
+
chatbot_purpose = f"Chatbot Mode: {', '.join(chatbot_mode)}\n"
|
| 128 |
+
print("22222222222222222222222222222222222222")
|
| 129 |
+
print(chatbot_purpose)
|
| 130 |
+
|
| 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 |
|
| 133 |
if history:
|
|
|
|
| 153 |
# βββ left column: your controls βββ
|
| 154 |
with gr.Column(scale=1):
|
| 155 |
use_spanish = gr.Checkbox(label="Use Spanish", value=False)
|
| 156 |
+
gr.Markdown("### What do you need help with?")
|
| 157 |
+
chatbot_mode = gr.CheckboxGroup(
|
| 158 |
+
choices=["Packing","Food/Attractions"],
|
| 159 |
+
label=None
|
| 160 |
+
)
|
| 161 |
gr.Markdown("### Where are you going?")
|
| 162 |
destinations = gr.CheckboxGroup(
|
| 163 |
choices=["San Francisco","Los Angeles"],
|
| 164 |
label=None
|
| 165 |
)
|
| 166 |
+
gr.Markdown("### What season are you travel in?")
|
| 167 |
season = gr.CheckboxGroup(
|
| 168 |
choices=["Warm/Dry","Cool/Wet"],
|
| 169 |
label=None
|
| 170 |
)
|
| 171 |
+
gr.Markdown("### What type of luggage?")
|
| 172 |
luggage_types = gr.CheckboxGroup(
|
| 173 |
choices=["Carry-on","Checked"],
|
| 174 |
label="Type"
|
| 175 |
)
|
| 176 |
luggage_size = gr.Slider(
|
| 177 |
minimum=10, maximum=100, step=10, value=20,
|
| 178 |
+
label="What is the size of you luggage (liters)?"
|
| 179 |
)
|
| 180 |
gr.Markdown("### Food preferences")
|
| 181 |
food_prefs = gr.CheckboxGroup(
|
|
|
|
| 206 |
msg,
|
| 207 |
chat_box,
|
| 208 |
use_spanish,
|
| 209 |
+
chatbot_mode,
|
| 210 |
destinations,
|
| 211 |
season,
|
| 212 |
luggage_types,
|