Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,9 @@ def get_weather(location:str,)-> dict: #it's import to specify the return type
|
|
30 |
"temperature": data["main"]["temp"],
|
31 |
"weather": data["weather"][0]["description"]
|
32 |
}
|
33 |
-
|
34 |
-
|
|
|
35 |
@tool
|
36 |
def get_current_time_in_timezone(timezone: str) -> str:
|
37 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
30 |
"temperature": data["main"]["temp"],
|
31 |
"weather": data["weather"][0]["description"]
|
32 |
}
|
33 |
+
else:
|
34 |
+
return {"error": "Could not fetch weather data"}
|
35 |
+
|
36 |
@tool
|
37 |
def get_current_time_in_timezone(timezone: str) -> str:
|
38 |
"""A tool that fetches the current local time in a specified timezone.
|