Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -362,28 +362,15 @@ def fetch_yelp_restaurants(location="Birmingham, AL, USA", term="Restaurant"):
|
|
362 |
yelp_data.append(restaurant_info)
|
363 |
return yelp_data
|
364 |
|
365 |
-
def format_restaurant_info(restaurant_info):
|
366 |
-
formatted_info = []
|
367 |
-
for restaurant in restaurant_info:
|
368 |
-
formatted_info.append(
|
369 |
-
f"**Name:** {restaurant['name']}\n"
|
370 |
-
f"**Rating:** {restaurant['rating']} stars\n"
|
371 |
-
f"**Reviews:** {restaurant['reviews']}\n"
|
372 |
-
f"**Phone:** {restaurant['phone']}\n"
|
373 |
-
f"**Snippet:** {restaurant['snippet']}\n"
|
374 |
-
f"**Services:** {restaurant['services']}\n"
|
375 |
-
f"**Yelp URL:** [Link]({restaurant['link']})\n"
|
376 |
-
)
|
377 |
-
return "\n\n".join(formatted_info)
|
378 |
-
|
379 |
def process_restaurant_query(query):
|
380 |
-
location = "Birmingham, AL, USA" # Default location
|
381 |
restaurant_info = fetch_yelp_restaurants(location=location, term=query)
|
382 |
formatted_info = format_restaurant_info(restaurant_info)
|
383 |
return formatted_info
|
384 |
|
385 |
|
386 |
|
|
|
387 |
def add_message(history, message):
|
388 |
history.append((message, None))
|
389 |
return history, gr.Textbox(value="", interactive=True, placeholder="Enter message or upload file...", show_label=False)
|
|
|
362 |
yelp_data.append(restaurant_info)
|
363 |
return yelp_data
|
364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
def process_restaurant_query(query):
|
366 |
+
location = "Birmingham, AL, USA" # Default location or dynamically extracted from the query
|
367 |
restaurant_info = fetch_yelp_restaurants(location=location, term=query)
|
368 |
formatted_info = format_restaurant_info(restaurant_info)
|
369 |
return formatted_info
|
370 |
|
371 |
|
372 |
|
373 |
+
|
374 |
def add_message(history, message):
|
375 |
history.append((message, None))
|
376 |
return history, gr.Textbox(value="", interactive=True, placeholder="Enter message or upload file...", show_label=False)
|