Spaces:
Sleeping
Sleeping
added duckduckgo to self_imports
Browse files
agent.py
CHANGED
|
@@ -26,7 +26,7 @@ class Agent:
|
|
| 26 |
self.tools = tools
|
| 27 |
self.imports = ['pandas', 'numpy', 'os', 'requests',
|
| 28 |
'tempfile', 'datetime', 'json', 'time', 're',
|
| 29 |
-
'openpyxl', 'pathlib', 'sys',
|
| 30 |
]
|
| 31 |
self.agent = CodeAgent(
|
| 32 |
model=self.model,
|
|
|
|
| 26 |
self.tools = tools
|
| 27 |
self.imports = ['pandas', 'numpy', 'os', 'requests',
|
| 28 |
'tempfile', 'datetime', 'json', 'time', 're',
|
| 29 |
+
'openpyxl', 'pathlib', 'sys', 'duckduckgo_search'
|
| 30 |
]
|
| 31 |
self.agent = CodeAgent(
|
| 32 |
model=self.model,
|
tools.py
CHANGED
|
@@ -100,13 +100,17 @@ def get_tools() -> List[Tool]:
|
|
| 100 |
Returns:
|
| 101 |
List[Tool]: List of initialized tool instances.
|
| 102 |
"""
|
| 103 |
-
|
| 104 |
-
DuckDuckGoSearchTool(),
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
return tools
|
|
|
|
| 100 |
Returns:
|
| 101 |
List[Tool]: List of initialized tool instances.
|
| 102 |
"""
|
| 103 |
+
try:
|
| 104 |
+
tools = [DuckDuckGoSearchTool(),
|
| 105 |
+
PythonInterpreterTool(),
|
| 106 |
+
WikipediaSearchTool(),
|
| 107 |
+
VisitWebpageTool(),
|
| 108 |
+
OpenAISpeechToTextTool(),
|
| 109 |
+
YouTubeTranscriptionTool(),
|
| 110 |
+
ReadFileTool(),
|
| 111 |
+
]
|
| 112 |
+
except Exception as e:
|
| 113 |
+
logger.error('error while instantiating the tools: %s', e)
|
| 114 |
+
return f'error instantiating the tools {str(e)}'
|
| 115 |
+
|
| 116 |
return tools
|