Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,12 +9,15 @@ from tools.final_answer import FinalAnswerTool
|
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
Args:
|
| 15 |
-
|
| 16 |
"""
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
@tool
|
| 20 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
| 11 |
@tool
|
| 12 |
+
def my_custom_tool(year:int)-> str: #it's import to specify the return type
|
| 13 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
"""A tool that fetches the population of USA at a specific year. Do a GET call on this API:
|
| 15 |
+
API: https://datausa.io/api/data?drilldowns=Nation&measures=Population, and get the population of the year from the response.
|
| 16 |
Args:
|
| 17 |
+
year: an integer representing a year
|
| 18 |
"""
|
| 19 |
+
response = requests.get('https://datausa.io/api/data?drilldowns=Nation&measures=Population')
|
| 20 |
+
return response.json()
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_current_time_in_timezone(timezone: str) -> str:
|