Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,11 +11,13 @@ from Gradio_UI import GradioUI
|
|
11 |
@tool
|
12 |
def web_search(location:str)-> 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 gather the current weather
|
15 |
Args:
|
16 |
location: The place where the weather should be checked
|
17 |
"""
|
18 |
-
|
|
|
|
|
19 |
|
20 |
@tool
|
21 |
def get_current_time_in_timezone(timezone: str) -> str:
|
@@ -54,7 +56,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
54 |
|
55 |
agent = CodeAgent(
|
56 |
model=model,
|
57 |
-
tools=[final_answer, web_search], ## add your tools here (don't remove final answer)
|
58 |
max_steps=6,
|
59 |
verbosity_level=1,
|
60 |
grammar=None,
|
|
|
11 |
@tool
|
12 |
def web_search(location:str)-> 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 gather the current weather for a given location using a search engine.
|
15 |
Args:
|
16 |
location: The place where the weather should be checked
|
17 |
"""
|
18 |
+
query = f"current weather in {location}"
|
19 |
+
result = DuckDuckGoSearchTool(query)
|
20 |
+
return result
|
21 |
|
22 |
@tool
|
23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
56 |
|
57 |
agent = CodeAgent(
|
58 |
model=model,
|
59 |
+
tools=[final_answer, web_search, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
60 |
max_steps=6,
|
61 |
verbosity_level=1,
|
62 |
grammar=None,
|