bstraehle commited on
Commit
b63dea2
·
verified ·
1 Parent(s): 7dae5d7

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +19 -2
agent.py CHANGED
@@ -1,2 +1,19 @@
1
- def run_agent(llm, task):
2
- return
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from smolagents import (
2
+ CodeAgent,
3
+ OpenAIServerModel,
4
+ DuckDuckGoSearchTool,
5
+ WikipediaSearchTool
6
+ )
7
+
8
+ def run_agent(model_id, question):
9
+ agent = CodeAgent(
10
+ model=OpenAIServerModel(model_id=model_id),
11
+ tools=[DuckDuckGoSearchTool(),
12
+ WikipediaSearchTool()],
13
+ add_base_tools=True,
14
+ max_steps=5,
15
+ verbosity_level=2,
16
+ additional_authorized_imports=["pandas", "numpy"]
17
+ )
18
+
19
+ return agent.run(question)