Spaces:
Running
Running
Update tool.py
Browse files
tool.py
CHANGED
@@ -23,11 +23,13 @@ class SimpleTool(Tool):
|
|
23 |
if departure_time is None:
|
24 |
from datetime import datetime
|
25 |
monday = datetime(2025, 1, 6, 11, 0)
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
23 |
if departure_time is None:
|
24 |
from datetime import datetime
|
25 |
monday = datetime(2025, 1, 6, 11, 0)
|
26 |
+
try:
|
27 |
+
directions_result = gmaps.directions(
|
28 |
+
start_location,
|
29 |
+
destination_location,
|
30 |
+
mode="transit",
|
31 |
+
departure_time=departure_time
|
32 |
+
)
|
33 |
+
return directions_result[0]["legs"][0]["duration"]["text"]
|
34 |
+
except Exception as e:
|
35 |
+
print(e, directions_result)
|