m-ric HF staff commited on
Commit
d2c8496
·
verified ·
1 Parent(s): 20cb02f

Update tool.py

Browse files
Files changed (1) hide show
  1. tool.py +3 -3
tool.py CHANGED
@@ -20,13 +20,13 @@ class SimpleTool(Tool):
20
 
21
  gmaps = googlemaps.Client(os.getenv("GMAPS_API_KEY"))
22
 
23
- if transportation is None:
24
- transportation = "transit"
25
  try:
26
  directions_result = gmaps.directions(
27
  start_location,
28
  destination_location,
29
- mode=transportation,
30
  departure_time=datetime(2025, 1, 6, 11, 0), # Start on a Monday morning
31
  )
32
  return directions_result[0]["legs"][0]["duration"]["text"]
 
20
 
21
  gmaps = googlemaps.Client(os.getenv("GMAPS_API_KEY"))
22
 
23
+ if transportation_mode is None:
24
+ transportation_mode = "transit"
25
  try:
26
  directions_result = gmaps.directions(
27
  start_location,
28
  destination_location,
29
+ mode=transportation_mode,
30
  departure_time=datetime(2025, 1, 6, 11, 0), # Start on a Monday morning
31
  )
32
  return directions_result[0]["legs"][0]["duration"]["text"]