get current year, it seems that the model's current year is 2023
Browse files
app.py
CHANGED
|
@@ -10,14 +10,12 @@ from Gradio_UI import GradioUI
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
-
def
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
-
"""A tool that
|
| 16 |
Args:
|
| 17 |
-
arg1: the first argument
|
| 18 |
-
arg2: the second argument
|
| 19 |
"""
|
| 20 |
-
return "
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -58,7 +56,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
-
tools=[final_answer, image_generation_tool, duckduck, visit_web_page], ## add your tools here (don't remove final answer)
|
| 62 |
# tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
|
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
+
def get_current_year()-> str: #it's import to specify the return type
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
+
"""A tool that returns the current year
|
| 16 |
Args:
|
|
|
|
|
|
|
| 17 |
"""
|
| 18 |
+
return f"The current year is {datetime.datetime.now().year}"
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 56 |
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
+
tools=[final_answer, image_generation_tool, duckduck, visit_web_page, get_current_time_in_timezone, get_current_year], ## add your tools here (don't remove final answer)
|
| 60 |
# tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|