Spaces:
Running
Running
Update app.py
Browse filesadding tools to the agent
app.py
CHANGED
|
@@ -19,12 +19,12 @@ def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
-
def
|
| 23 |
"""A tool that searches for a given string on the web and returns relevant information.
|
| 24 |
Args:
|
| 25 |
query: A string representing the search query.
|
| 26 |
"""
|
| 27 |
-
res = DuckDuckGoSearchTool().
|
| 28 |
if res:
|
| 29 |
return res
|
| 30 |
else:
|
|
@@ -63,7 +63,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 63 |
|
| 64 |
agent = CodeAgent(
|
| 65 |
model=model,
|
| 66 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 67 |
max_steps=6,
|
| 68 |
verbosity_level=1,
|
| 69 |
grammar=None,
|
|
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
+
def web_search(query: str) -> str:
|
| 23 |
"""A tool that searches for a given string on the web and returns relevant information.
|
| 24 |
Args:
|
| 25 |
query: A string representing the search query.
|
| 26 |
"""
|
| 27 |
+
res = DuckDuckGoSearchTool().web_search(query)
|
| 28 |
if res:
|
| 29 |
return res
|
| 30 |
else:
|
|
|
|
| 63 |
|
| 64 |
agent = CodeAgent(
|
| 65 |
model=model,
|
| 66 |
+
tools=[final_answer, web_search, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 67 |
max_steps=6,
|
| 68 |
verbosity_level=1,
|
| 69 |
grammar=None,
|