hp1318 commited on
Commit
8d3c638
·
verified ·
1 Parent(s): 5c0bd6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -76,14 +76,10 @@ def get_top_restaurants(city: str) -> str:
76
  """
77
  try:
78
  search_tool = DuckDuckGoSearchTool()
79
- results = search_tool.search(f"Top 5 restaurants in {city}")
80
-
81
- if isinstance(results, list) and len(results) > 0:
82
- top_restaurants = '\n'.join(
83
- [f"{i+1}. {r.get('title', 'Unknown')} - {r.get('link', 'No link')}"
84
- for i, r in enumerate(results[:5])]
85
- )
86
- return f"Top 5 Restaurants in {city}:\n{top_restaurants}"
87
 
88
  return "No restaurant data found."
89
 
 
76
  """
77
  try:
78
  search_tool = DuckDuckGoSearchTool()
79
+ results = search_tool.forward(f"Top 5 restaurants in {city}")
80
+
81
+ if results:
82
+ return f"Top 5 Restaurants in {city}:\n{results}"
 
 
 
 
83
 
84
  return "No restaurant data found."
85