Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,20 +3,17 @@ import datetime
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
|
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
|
| 8 |
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
|
| 13 |
-
|
| 14 |
-
"""A tool that does nothing yet
|
| 15 |
-
Args:
|
| 16 |
-
arg1: the first argument
|
| 17 |
-
arg2: the second argument
|
| 18 |
"""
|
| 19 |
-
return
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -51,7 +48,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 51 |
|
| 52 |
agent = CodeAgent(
|
| 53 |
model=model,
|
| 54 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 55 |
max_steps=6,
|
| 56 |
verbosity_level=1,
|
| 57 |
grammar=None,
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
import platform
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
|
| 9 |
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 my_virtual_house()-> str: #it's import to specify the return type
|
| 14 |
+
"""A tool that tells in what house you live in.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"""
|
| 16 |
+
return platform.system()
|
| 17 |
|
| 18 |
@tool
|
| 19 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 48 |
|
| 49 |
agent = CodeAgent(
|
| 50 |
model=model,
|
| 51 |
+
tools=[final_answer,DuckDuckGoSearchTool,image_generation_tool,my_virtual_house], ## add your tools here (don't remove final answer)
|
| 52 |
max_steps=6,
|
| 53 |
verbosity_level=1,
|
| 54 |
grammar=None,
|