Spaces:
Sleeping
Sleeping
add docstring
Browse files
app.py
CHANGED
|
@@ -47,9 +47,12 @@ def get_population(country:str)-> str: #it's import to specify the return type
|
|
| 47 |
|
| 48 |
@tool
|
| 49 |
def get_weather(city:str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
API_KEY = os.getenv("WAPI")
|
| 51 |
-
|
| 52 |
-
URL = f"http://api.weatherapi.com/v1/current.json?key={API_KEY}&q={CITY}&aqi=no"
|
| 53 |
response = requests.get(URL)
|
| 54 |
if response.status_code == 200:
|
| 55 |
data = response.json()
|
|
|
|
| 47 |
|
| 48 |
@tool
|
| 49 |
def get_weather(city:str) -> str:
|
| 50 |
+
"""A tool that returns the population for a country
|
| 51 |
+
Args:
|
| 52 |
+
city: a string representing the a city to find the weather for
|
| 53 |
+
"""
|
| 54 |
API_KEY = os.getenv("WAPI")
|
| 55 |
+
URL = f"http://api.weatherapi.com/v1/current.json?key={API_KEY}&q={city}&aqi=no"
|
|
|
|
| 56 |
response = requests.get(URL)
|
| 57 |
if response.status_code == 200:
|
| 58 |
data = response.json()
|