Updated tools
Browse files
agent.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel
|
| 2 |
from agent_tools import *
|
| 3 |
import os
|
| 4 |
|
|
@@ -13,8 +13,10 @@ model = LiteLLMModel("gemini/gemini-2.5-flash",api_key=api_key)
|
|
| 13 |
# Initialize tools
|
| 14 |
search_tool = DuckDuckGoSearchTool(max_results=5)
|
| 15 |
wiki_tool = WikipediaSearchTool()
|
| 16 |
-
|
|
|
|
| 17 |
calculator_tools = [addition_tool, subtraction_tool, multiplication_tool, division_tool, exponent_tool, modulus_tool]
|
|
|
|
| 18 |
|
| 19 |
# Agent Definitions
|
| 20 |
calculator_agent = CodeAgent(
|
|
@@ -27,9 +29,9 @@ calculator_agent = CodeAgent(
|
|
| 27 |
)
|
| 28 |
|
| 29 |
main_agent = CodeAgent(
|
| 30 |
-
tools=
|
| 31 |
model=model,
|
| 32 |
-
additional_authorized_imports = ['requests', 'bs4', 'whisper', 'langchain_community', 'langchain'],
|
| 33 |
description = system_prompt,
|
| 34 |
managed_agents = [calculator_agent],
|
| 35 |
max_steps=10,
|
|
|
|
| 1 |
+
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel, VisitWebpageTool, PythonInterpreterTool
|
| 2 |
from agent_tools import *
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 13 |
# Initialize tools
|
| 14 |
search_tool = DuckDuckGoSearchTool(max_results=5)
|
| 15 |
wiki_tool = WikipediaSearchTool()
|
| 16 |
+
visit_webpage_tool = VisitWebpageTool()
|
| 17 |
+
python_interpreter_tool = PythonInterpreterTool()
|
| 18 |
calculator_tools = [addition_tool, subtraction_tool, multiplication_tool, division_tool, exponent_tool, modulus_tool]
|
| 19 |
+
main_tools = [search_tool, wiki_tool, transcriber_tool, visit_webpage_tool, python_interpreter_tool, excel_loader_tool]
|
| 20 |
|
| 21 |
# Agent Definitions
|
| 22 |
calculator_agent = CodeAgent(
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
main_agent = CodeAgent(
|
| 32 |
+
tools=main_tools,
|
| 33 |
model=model,
|
| 34 |
+
additional_authorized_imports = ['requests', 'bs4', 'whisper', 'langchain_community', 'langchain', 'markdownify', 'openpyxl'],
|
| 35 |
description = system_prompt,
|
| 36 |
managed_agents = [calculator_agent],
|
| 37 |
max_steps=10,
|