Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,16 +9,18 @@ from tools.web_search import DuckDuckGoSearchTool
|
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
12 |
-
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
13 |
@tool
|
14 |
-
def
|
15 |
-
|
16 |
-
"""A tool that does nothing yet
|
17 |
Args:
|
18 |
-
|
19 |
-
|
20 |
"""
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
|
23 |
@tool
|
24 |
def get_current_time_in_timezone(timezone: str) -> str:
|
@@ -59,7 +61,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
59 |
|
60 |
agent = CodeAgent(
|
61 |
model=model,
|
62 |
-
tools=[web_search, visit_webpage,
|
63 |
max_steps=6,
|
64 |
verbosity_level=1,
|
65 |
grammar=None,
|
|
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
|
|
12 |
@tool
|
13 |
+
def get_top_keywods_by_city(city: str, time: int)-> str[]:
|
14 |
+
"""A tool that returns a list with top 5 most popular things to do based on the city
|
|
|
15 |
Args:
|
16 |
+
city: A string representing a city
|
17 |
+
time: A timestamp representing a current time in a city
|
18 |
"""
|
19 |
+
print(city, time)
|
20 |
+
if city == "Athens":
|
21 |
+
return ["Acropolis", "Philosofy", "Sea", "Food", "Drinks"]
|
22 |
+
|
23 |
+
return ["Other"]
|
24 |
|
25 |
@tool
|
26 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
61 |
|
62 |
agent = CodeAgent(
|
63 |
model=model,
|
64 |
+
tools=[get_current_time_in_timezone, get_top_keywods_by_city, web_search, visit_webpage, final_answer], ## add your tools here (don't remove final answer)
|
65 |
max_steps=6,
|
66 |
verbosity_level=1,
|
67 |
grammar=None,
|