venkat-srinivasan-nexusflow commited on
Commit
80aa8b6
Β·
verified Β·
1 Parent(s): 97b846a

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +3 -2
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) == 2:
298
  # Likely a latitude and longitude tuple
299
- location = f"lat: {location[0]}, long: {location[1]}"
 
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):