Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_weather(city: str) -> str:
|
| 38 |
-
"""Get current weather for a city using
|
| 39 |
Args:
|
| 40 |
city: Name of the city
|
| 41 |
"""
|
|
@@ -50,11 +50,11 @@ def get_weather(city: str) -> str:
|
|
| 50 |
}
|
| 51 |
|
| 52 |
response = requests.get(url, params=params)
|
| 53 |
-
|
| 54 |
data = response.json()
|
| 55 |
-
|
| 56 |
weather = data["weather"][0]["description"]
|
| 57 |
temp = data["main"]["temp"]
|
|
|
|
|
|
|
| 58 |
|
| 59 |
return f"The weather in {city} is {weather}, temperature {temp}°C"
|
| 60 |
except Exception as e:
|
|
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_weather(city: str) -> str:
|
| 38 |
+
"""Get current weather for a city using openweather in API.
|
| 39 |
Args:
|
| 40 |
city: Name of the city
|
| 41 |
"""
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
response = requests.get(url, params=params)
|
|
|
|
| 53 |
data = response.json()
|
|
|
|
| 54 |
weather = data["weather"][0]["description"]
|
| 55 |
temp = data["main"]["temp"]
|
| 56 |
+
temp_min = data["main"]["temp_min"]
|
| 57 |
+
temp_max = data["main"]["temp_max"]
|
| 58 |
|
| 59 |
return f"The weather in {city} is {weather}, temperature {temp}°C"
|
| 60 |
except Exception as e:
|