Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,11 +41,12 @@ def get_weather(location: str, api_key: str) -> dict:
|
|
| 41 |
A tool that fetches the current weather data for a specified location.
|
| 42 |
|
| 43 |
Args:
|
| 44 |
-
location
|
| 45 |
-
api_key
|
| 46 |
|
| 47 |
Returns:
|
| 48 |
-
|
|
|
|
| 49 |
"""
|
| 50 |
base_url = "https://api.openweathermap.org/data/2.5/weather"
|
| 51 |
params = {
|
|
|
|
| 41 |
A tool that fetches the current weather data for a specified location.
|
| 42 |
|
| 43 |
Args:
|
| 44 |
+
location: A string representing the city name to get weather data (e.g., 'New York').
|
| 45 |
+
api_key: A string representing your OpenWeatherMap API key.
|
| 46 |
|
| 47 |
Returns:
|
| 48 |
+
A dictionary containing weather details such as city name, temperature, description, humidity, and wind speed.
|
| 49 |
+
If an error occurs, it returns a dictionary with an "error" key and an error message.
|
| 50 |
"""
|
| 51 |
base_url = "https://api.openweathermap.org/data/2.5/weather"
|
| 52 |
params = {
|