Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,9 @@ def get_temperature(location: str) -> str:
|
|
40 |
location: The name of the city or place (e.g., 'New York').
|
41 |
"""
|
42 |
try:
|
43 |
-
response = requests.get(f'https://wttr.in/{location}?format=%t')
|
44 |
if response.status_code == 200:
|
45 |
-
return f"The current temperature in {location} is {response.text}"
|
46 |
else:
|
47 |
return "Failed to retrieve temperature. Please check the location name."
|
48 |
except Exception as e:
|
|
|
40 |
location: The name of the city or place (e.g., 'New York').
|
41 |
"""
|
42 |
try:
|
43 |
+
response = requests.get(f'https://wttr.in/{location}?format=%t&u')
|
44 |
if response.status_code == 200:
|
45 |
+
return f"The current temperature in {location} is {response.text} °C"
|
46 |
else:
|
47 |
return "Failed to retrieve temperature. Please check the location name."
|
48 |
except Exception as e:
|