Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def current_weather(location: str)-> str:
|
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that fetches the temperature and climate description of the specified location.
|
| 15 |
Args:
|
| 16 |
-
location
|
| 17 |
Returns:
|
| 18 |
str: Weather description and temperature of the specified location
|
| 19 |
"""
|
|
@@ -25,7 +25,7 @@ def current_weather(location: str)-> str:
|
|
| 25 |
data = response.json()
|
| 26 |
return f"Weather of {location} is {data['current']['weather_descriptions']} with the temperature {data['current']['temperature']}"
|
| 27 |
except Exception as e:
|
| 28 |
-
return f"Error fetching weather for ''{location': str
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 31 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that fetches the temperature and climate description of the specified location.
|
| 15 |
Args:
|
| 16 |
+
location: A string representing a valid location (e.g., 'New York')
|
| 17 |
Returns:
|
| 18 |
str: Weather description and temperature of the specified location
|
| 19 |
"""
|
|
|
|
| 25 |
data = response.json()
|
| 26 |
return f"Weather of {location} is {data['current']['weather_descriptions']} with the temperature {data['current']['temperature']}"
|
| 27 |
except Exception as e:
|
| 28 |
+
return f"Error fetching weather for ''{location': str(e)}"
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 31 |
"""A tool that fetches the current local time in a specified timezone.
|