Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def current_weather(
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that fetches the temperature and climate description of the specified location.
|
| 15 |
Args:
|
|
@@ -18,7 +18,7 @@ def current_weather(loction: str)-> str:
|
|
| 18 |
|
| 19 |
key = "4da8241f3e302b39314e95cf04d4552e"
|
| 20 |
url = f"https://api.weatherstack.com/current?access_key={key}"
|
| 21 |
-
query = {"query":
|
| 22 |
response = requests.get(url, params=query)
|
| 23 |
data = response.json()
|
| 24 |
return f"Weather of {location} is {data['current']['weather_descriptions']} with the temperature {data['current']['temperature']}"
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def current_weather(location: str)-> str:
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""A tool that fetches the temperature and climate description of the specified location.
|
| 15 |
Args:
|
|
|
|
| 18 |
|
| 19 |
key = "4da8241f3e302b39314e95cf04d4552e"
|
| 20 |
url = f"https://api.weatherstack.com/current?access_key={key}"
|
| 21 |
+
query = {"query": location}
|
| 22 |
response = requests.get(url, params=query)
|
| 23 |
data = response.json()
|
| 24 |
return f"Weather of {location} is {data['current']['weather_descriptions']} with the temperature {data['current']['temperature']}"
|