Spaces:
Sleeping
Sleeping
fix for DuckDuckGoSearchRun
Browse files
app.py
CHANGED
|
@@ -7,17 +7,7 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
|
| 11 |
-
def duckduckgo_search(query: str) -> str:
|
| 12 |
-
"""A tool that searches the web
|
| 13 |
-
Args:
|
| 14 |
-
query: The search query string.
|
| 15 |
-
"""
|
| 16 |
-
try:
|
| 17 |
-
search_tool = DuckDuckGoSearchTool()
|
| 18 |
-
return search_tool(str);
|
| 19 |
-
except Exception as e:
|
| 20 |
-
return f"Error performing search: {str(e)}"
|
| 21 |
|
| 22 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 23 |
@tool
|
|
@@ -68,7 +58,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 68 |
|
| 69 |
agent = CodeAgent(
|
| 70 |
model=model,
|
| 71 |
-
tools=[
|
| 72 |
max_steps=6,
|
| 73 |
verbosity_level=1,
|
| 74 |
grammar=None,
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
search = DuckDuckGoSearchRun()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
@tool
|
|
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
+
tools=[search, get_current_time_in_timezone, image_generation_tool, final_answer], ## add your tools here (don't remove final answer)
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|