Spaces:
Running
Running
Upload tool
Browse files- requirements.txt +1 -1
- tool.py +3 -1
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
googlemaps
|
2 |
smolagents
|
|
|
|
|
|
1 |
smolagents
|
2 |
+
googlemaps
|
tool.py
CHANGED
@@ -15,10 +15,12 @@ class SimpleTool(Tool):
|
|
15 |
destination_location: the place of arrival
|
16 |
transportation_mode: The transportation mode, in 'driving', 'walking', 'bicycling', or 'transit'. Defaults to 'driving'.
|
17 |
"""
|
|
|
18 |
import googlemaps
|
19 |
-
import os
|
20 |
from datetime import datetime
|
|
|
21 |
gmaps = googlemaps.Client(os.getenv("GMAPS_API_KEY"))
|
|
|
22 |
if transportation_mode is None:
|
23 |
transportation_mode = "driving"
|
24 |
try:
|
|
|
15 |
destination_location: the place of arrival
|
16 |
transportation_mode: The transportation mode, in 'driving', 'walking', 'bicycling', or 'transit'. Defaults to 'driving'.
|
17 |
"""
|
18 |
+
import os # All imports are placed within the function, to allow for sharing to Hub.
|
19 |
import googlemaps
|
|
|
20 |
from datetime import datetime
|
21 |
+
|
22 |
gmaps = googlemaps.Client(os.getenv("GMAPS_API_KEY"))
|
23 |
+
|
24 |
if transportation_mode is None:
|
25 |
transportation_mode = "driving"
|
26 |
try:
|