Spaces:
Runtime error
Runtime error
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -283,8 +283,13 @@ class Tools:
|
|
| 283 |
- place_names (list): The name of the establishment. This should be a physical location name. You can provide multiple inputs.
|
| 284 |
- location (str) : The location where the restaurant is located. Optional argument.
|
| 285 |
"""
|
| 286 |
-
print (f"Location found: {location}")
|
| 287 |
all_reviews = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
for place_name in place_names:
|
| 289 |
if isinstance(place_name, str):
|
| 290 |
if location and isinstance(location, list) and len(location) > 0:
|
|
|
|
| 283 |
- place_names (list): The name of the establishment. This should be a physical location name. You can provide multiple inputs.
|
| 284 |
- location (str) : The location where the restaurant is located. Optional argument.
|
| 285 |
"""
|
|
|
|
| 286 |
all_reviews = []
|
| 287 |
+
if location and isinstance(location, list) and len(location) > 0 and isinstance(location[0], dict):
|
| 288 |
+
# Output of getlatlong likely. Let's reformat it.
|
| 289 |
+
location = location[0]
|
| 290 |
+
location = location['address_components'][0]['long_name']
|
| 291 |
+
|
| 292 |
+
print (f"Location found: {location}")
|
| 293 |
for place_name in place_names:
|
| 294 |
if isinstance(place_name, str):
|
| 295 |
if location and isinstance(location, list) and len(location) > 0:
|