Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,7 +41,8 @@ def get_weather(city:str,lat: float, lng:float)-> str:
|
|
| 41 |
if response.status_code == 200:
|
| 42 |
data = response.json()
|
| 43 |
weather = data["current_weather"]
|
| 44 |
-
|
|
|
|
| 45 |
else:
|
| 46 |
return "Error fetching weather data."
|
| 47 |
|
|
|
|
| 41 |
if response.status_code == 200:
|
| 42 |
data = response.json()
|
| 43 |
weather = data["current_weather"]
|
| 44 |
+
description = weather_descriptions[weather['weathercode']]
|
| 45 |
+
return f"The weather in {city} is {weather['temperature']}°C - {description}."
|
| 46 |
else:
|
| 47 |
return "Error fetching weather data."
|
| 48 |
|