Pijush2023 commited on
Commit
4debf05
·
verified ·
1 Parent(s): ab60062

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1016,21 +1016,21 @@ def fetch_yelp_restaurants():
1016
 
1017
  response_text = ""
1018
 
1019
- for result in organic_results[:5]: # Limiting to top 5 restaurants
1020
  name = result.get("title", "No name")
1021
  rating = result.get("rating", "No rating")
1022
  reviews = result.get("reviews", "No reviews")
1023
  phone = result.get("phone", "Not Available")
1024
  snippet = result.get("snippet", "Not Available")
1025
- location = result.get("location", "Birmingham, AL")
1026
  link = result.get("link", "#")
1027
 
1028
  if isinstance(snippet, list):
1029
  snippet = " | ".join(snippet[:5]) # Limiting to top 5 snippets
1030
 
1031
  # Format the output for each restaurant
1032
- response_text += f"**[{name}]({link})**\n" # Name in bold with clickable link
1033
- response_text += f"*{location}*\n" # Location in italics
1034
  response_text += f"**Contact No:** {phone}\n"
1035
  response_text += f"**Rating:** {star_rating(rating)} ({rating} stars, {reviews} reviews)\n"
1036
  response_text += f"**Snippet:** {snippet}\n"
@@ -1042,6 +1042,7 @@ def fetch_yelp_restaurants():
1042
 
1043
 
1044
 
 
1045
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
1046
  with gr.Row():
1047
  with gr.Column():
 
1016
 
1017
  response_text = ""
1018
 
1019
+ for result in organic_results[:10]: # Limiting to top 10 restaurants
1020
  name = result.get("title", "No name")
1021
  rating = result.get("rating", "No rating")
1022
  reviews = result.get("reviews", "No reviews")
1023
  phone = result.get("phone", "Not Available")
1024
  snippet = result.get("snippet", "Not Available")
1025
+ location = f"{name}, Birmingham, AL"
1026
  link = result.get("link", "#")
1027
 
1028
  if isinstance(snippet, list):
1029
  snippet = " | ".join(snippet[:5]) # Limiting to top 5 snippets
1030
 
1031
  # Format the output for each restaurant
1032
+ response_text += f"[{name}]({link})\n" # Name with clickable link, no bold
1033
+ response_text += f"*{location}*\n" # Location with restaurant name and "Birmingham, AL"
1034
  response_text += f"**Contact No:** {phone}\n"
1035
  response_text += f"**Rating:** {star_rating(rating)} ({rating} stars, {reviews} reviews)\n"
1036
  response_text += f"**Snippet:** {snippet}\n"
 
1042
 
1043
 
1044
 
1045
+
1046
  with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
1047
  with gr.Row():
1048
  with gr.Column():