Spaces:
Sleeping
Sleeping
change prompt
Browse files
app.py
CHANGED
@@ -147,7 +147,7 @@ def get_top_5_destinations(user_query):
|
|
147 |
return "Tidak ada tempat yang ditemukan."
|
148 |
|
149 |
top_places = []
|
150 |
-
for i, (place, similarity) in enumerate(similar_places):
|
151 |
top_places.append({
|
152 |
'name': place['Place_Name'],
|
153 |
'city': place['City'],
|
@@ -170,10 +170,10 @@ def generate_response(user_query, top_places):
|
|
170 |
|
171 |
# System prompt: Simplified and focused on returning only the recommendations
|
172 |
system_prompt = """
|
173 |
-
You are a tour guide assistant. Your task is to present the following tourism recommendations to the user in Bahasa Indonesia.
|
174 |
- For each destination, include the name, city, category, rating, and a short description.
|
175 |
- Do not provide any additional commentary.
|
176 |
-
- Only return
|
177 |
"""
|
178 |
|
179 |
# Generate the response using the model
|
@@ -201,7 +201,7 @@ def chatbot(user_query):
|
|
201 |
return top_places
|
202 |
|
203 |
# only the first 5 element of top_places
|
204 |
-
response = generate_response(user_query, top_places
|
205 |
|
206 |
return response
|
207 |
|
|
|
147 |
return "Tidak ada tempat yang ditemukan."
|
148 |
|
149 |
top_places = []
|
150 |
+
for i, (place, similarity) in enumerate(similar_places[:10]):
|
151 |
top_places.append({
|
152 |
'name': place['Place_Name'],
|
153 |
'city': place['City'],
|
|
|
170 |
|
171 |
# System prompt: Simplified and focused on returning only the recommendations
|
172 |
system_prompt = """
|
173 |
+
You are a tour guide assistant. Your task is to present the following tourism recommendations based on what user want and needs to the user in Bahasa Indonesia.
|
174 |
- For each destination, include the name, city, category, rating, and a short description.
|
175 |
- Do not provide any additional commentary.
|
176 |
+
- Only and must only return 5 places that suitable what user wants and provided the data in a clear and concise format.
|
177 |
"""
|
178 |
|
179 |
# Generate the response using the model
|
|
|
201 |
return top_places
|
202 |
|
203 |
# only the first 5 element of top_places
|
204 |
+
response = generate_response(user_query, top_places)
|
205 |
|
206 |
return response
|
207 |
|