Update agent.py
Browse files
agent.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import
|
| 2 |
from agent_tools import *
|
| 3 |
import os
|
| 4 |
|
|
@@ -11,12 +11,22 @@ api_key = os.environ.get("GOOGLE_API_KEY")
|
|
| 11 |
model = LiteLLMModel("gemini/gemini-2.5-flash",api_key=api_key)
|
| 12 |
|
| 13 |
# Initialize tools
|
| 14 |
-
search_tool =
|
| 15 |
wiki_search_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,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
authorized_imports = ['requests', 'bs4', 'whisper', 'langchain_community', 'langchain', 'markdownify', 'openpyxl', 'tabulate']
|
| 21 |
|
| 22 |
# Agent Definitions
|
|
|
|
| 1 |
+
from smolagents import WebSearchTool, CodeAgent, WikipediaSearchTool, LiteLLMModel, VisitWebpageTool, PythonInterpreterTool, FinalAnswerTool, UserInputTool
|
| 2 |
from agent_tools import *
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 11 |
model = LiteLLMModel("gemini/gemini-2.5-flash",api_key=api_key)
|
| 12 |
|
| 13 |
# Initialize tools
|
| 14 |
+
search_tool = WebSearchTool()
|
| 15 |
wiki_search_tool = WikipediaSearchTool()
|
| 16 |
visit_webpage_tool = VisitWebpageTool()
|
| 17 |
python_interpreter_tool = PythonInterpreterTool()
|
| 18 |
+
final_answer_tool = FinalAnswerTool()
|
| 19 |
+
user_input_tool = UserInputTool()
|
| 20 |
calculator_tools = [addition_tool, subtraction_tool, multiplication_tool, division_tool, exponent_tool, modulus_tool]
|
| 21 |
+
main_tools = [search_tool,
|
| 22 |
+
wiki_search_tool,
|
| 23 |
+
transcriber_tool,
|
| 24 |
+
visit_webpage_tool,
|
| 25 |
+
python_interpreter_tool,
|
| 26 |
+
excel_loader_tool,
|
| 27 |
+
final_answer_tool,
|
| 28 |
+
user_input_tool,
|
| 29 |
+
]
|
| 30 |
authorized_imports = ['requests', 'bs4', 'whisper', 'langchain_community', 'langchain', 'markdownify', 'openpyxl', 'tabulate']
|
| 31 |
|
| 32 |
# Agent Definitions
|