Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -124,16 +124,44 @@ def respond(message, history, use_spanish, chatbot_mode, destinations, trip_leng
|
|
| 124 |
f"Food: {', '.join(food_prefs)}\n"
|
| 125 |
)
|
| 126 |
|
| 127 |
-
chatbot_purpose = f"Chatbot Mode: {'
|
| 128 |
print(chatbot_purpose)
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
if chatbot_mode == "Packing":
|
| 131 |
-
messages = [{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
elif chatbot_mode == "Food/Attractions":
|
| 133 |
-
messages = [{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
else:
|
| 135 |
-
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
# if history:
|
| 138 |
# messages.extend(history)
|
| 139 |
|
|
|
|
| 124 |
f"Food: {', '.join(food_prefs)}\n"
|
| 125 |
)
|
| 126 |
|
| 127 |
+
chatbot_purpose = f"Chatbot Mode: {chatbot_mode or 'Not specified'}"
|
| 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 |
+
# else:
|
| 135 |
+
# messages = [{"role": "system", "content": f"You're a friendly and gen z chatbot helping travellers plan their trip to San Francisco and/or Los Angeles."}]
|
| 136 |
+
|
| 137 |
+
|
| 138 |
if chatbot_mode == "Packing":
|
| 139 |
+
messages = [{
|
| 140 |
+
"role": "system",
|
| 141 |
+
"content": (
|
| 142 |
+
f"You're a friendly and Gen Z chatbot. Base your response on the provided context:\n"
|
| 143 |
+
f"{str_top_weather}\n\n{str_top_luggage}"
|
| 144 |
+
)
|
| 145 |
+
}]
|
| 146 |
elif chatbot_mode == "Food/Attractions":
|
| 147 |
+
messages = [{
|
| 148 |
+
"role": "system",
|
| 149 |
+
"content": (
|
| 150 |
+
f"You're a friendly and Gen Z chatbot. Base your response on the provided context:\n"
|
| 151 |
+
f"{str_top_food}\n\n{str_top_attraction}"
|
| 152 |
+
)
|
| 153 |
+
}]
|
| 154 |
else:
|
| 155 |
+
# Default mode: general travel assistant
|
| 156 |
+
messages = [{
|
| 157 |
+
"role": "system",
|
| 158 |
+
"content": (
|
| 159 |
+
f"You're a friendly and Gen Z chatbot helping travelers plan their trip. "
|
| 160 |
+
f"You can help with luggage, weather, food, and attractions. "
|
| 161 |
+
f"Use any relevant context provided."
|
| 162 |
+
)
|
| 163 |
+
}]
|
| 164 |
+
|
| 165 |
# if history:
|
| 166 |
# messages.extend(history)
|
| 167 |
|