Spaces:
Runtime error
Runtime error
venkat-srinivasan-nexusflow
commited on
Update tools.py
Browse files
tools.py
CHANGED
@@ -294,9 +294,10 @@ class Tools:
|
|
294 |
# No matching spaces found in the API, len of 0
|
295 |
if len(location) == 0:
|
296 |
location = None
|
297 |
-
elif len(location) ==
|
298 |
# Likely a latitude and longitude tuple
|
299 |
-
|
|
|
300 |
else:
|
301 |
location = None
|
302 |
if location and isinstance(location, dict):
|
|
|
294 |
# No matching spaces found in the API, len of 0
|
295 |
if len(location) == 0:
|
296 |
location = None
|
297 |
+
elif len(location) == 1 and isinstance(location[0], dict):
|
298 |
# Likely a latitude and longitude tuple
|
299 |
+
latlong = location["geometry"]["location"]
|
300 |
+
location = f"lat: {latlong['lat']}, long: {location['lng']}"
|
301 |
else:
|
302 |
location = None
|
303 |
if location and isinstance(location, dict):
|