Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,7 +85,7 @@ def get_weather_description(code):
|
|
| 85 |
|
| 86 |
@tool
|
| 87 |
def get_weather(city: str) -> str:
|
| 88 |
-
"""A tool that fetches the current weather of a specified city.
|
| 89 |
Args:
|
| 90 |
city: A string representing a city
|
| 91 |
"""
|
|
@@ -99,7 +99,7 @@ def get_weather(city: str) -> str:
|
|
| 99 |
windspeed = weather_data['current_weather']['windspeed']
|
| 100 |
wind_unit = weather_data['current_weather_units']['windspeed']
|
| 101 |
weather_description = get_weather_description(weather_data['current_weather']['weathercode'])
|
| 102 |
-
return f"
|
| 103 |
else:
|
| 104 |
return "Error on fetching weather data."
|
| 105 |
|
|
|
|
| 85 |
|
| 86 |
@tool
|
| 87 |
def get_weather(city: str) -> str:
|
| 88 |
+
"""A tool that fetches the current weather information of a specified city.
|
| 89 |
Args:
|
| 90 |
city: A string representing a city
|
| 91 |
"""
|
|
|
|
| 99 |
windspeed = weather_data['current_weather']['windspeed']
|
| 100 |
wind_unit = weather_data['current_weather_units']['windspeed']
|
| 101 |
weather_description = get_weather_description(weather_data['current_weather']['weathercode'])
|
| 102 |
+
return f"This is the weather on {city}. Temperature on {city} is {temperature}{unit}, the windspeed is {windspeed}{wind_unit} and the condition is {weather_description}"
|
| 103 |
else:
|
| 104 |
return "Error on fetching weather data."
|
| 105 |
|