Get the coordinates of a location
(location:str)
| 52 | |
| 53 | @tool.get("/get_coordinates") |
| 54 | def get_coordinates(location:str): |
| 55 | """Get the coordinates of a location""" |
| 56 | url = BASE_URL + "Locations" |
| 57 | params = { |
| 58 | "query": location, |
| 59 | "key": KEY |
| 60 | } |
| 61 | response = requests.get(url, params=params) |
| 62 | json_data = response.json() |
| 63 | coordinates = json_data["resourceSets"][0]["resources"][0]["point"]["coordinates"] |
| 64 | return coordinates |
| 65 | |
| 66 | @tool.get("/search_nearby") |
| 67 | def search_nearyby(search_term:str="restaurant", latitude:float = 0.0, longitude:float = 0.0, places:str='unknown', radius:int = 5000): # radius in meters |