Thomas Hatting commited on
Commit
c4d250f
·
verified ·
1 Parent(s): 2108926

Upload agent

Browse files
Files changed (3) hide show
  1. agent.json +13 -5
  2. app.py +13 -3
  3. requirements.txt +3 -0
agent.json CHANGED
@@ -1,12 +1,17 @@
1
  {
2
  "tools": [
 
 
 
 
 
3
  "final_answer"
4
  ],
5
  "model": {
6
  "class": "HfApiModel",
7
  "data": {
8
- "last_input_token_count": null,
9
- "last_output_token_count": null,
10
  "model_id": "Qwen/Qwen2.5-Coder-32B-Instruct",
11
  "provider": null
12
  }
@@ -31,14 +36,17 @@
31
  "post_messages": "Based on the above, please provide an answer to the following user request:\n{{task}}"
32
  }
33
  },
34
- "max_steps": 6,
35
- "verbosity_level": 1,
36
  "grammar": null,
37
  "planning_interval": null,
38
  "name": null,
39
  "description": null,
40
  "requirements": [
41
- "smolagents"
 
 
 
42
  ],
43
  "authorized_imports": [
44
  "time",
 
1
  {
2
  "tools": [
3
+ "web_search",
4
+ "visit_webpage",
5
+ "suggest_menu",
6
+ "catering_service_tool",
7
+ "superhero_party_theme_generator",
8
  "final_answer"
9
  ],
10
  "model": {
11
  "class": "HfApiModel",
12
  "data": {
13
+ "last_input_token_count": 4231,
14
+ "last_output_token_count": 120,
15
  "model_id": "Qwen/Qwen2.5-Coder-32B-Instruct",
16
  "provider": null
17
  }
 
36
  "post_messages": "Based on the above, please provide an answer to the following user request:\n{{task}}"
37
  }
38
  },
39
+ "max_steps": 10,
40
+ "verbosity_level": 2,
41
  "grammar": null,
42
  "planning_interval": null,
43
  "name": null,
44
  "description": null,
45
  "requirements": [
46
+ "requests",
47
+ "markdownify",
48
+ "smolagents",
49
+ "duckduckgo_search"
50
  ],
51
  "authorized_imports": [
52
  "time",
app.py CHANGED
@@ -5,6 +5,11 @@ from smolagents import GradioUI, CodeAgent, HfApiModel
5
  # Get current directory path
6
  CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
7
 
 
 
 
 
 
8
  from tools.final_answer import FinalAnswerTool as FinalAnswer
9
 
10
 
@@ -14,6 +19,11 @@ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
14
  provider=None,
15
  )
16
 
 
 
 
 
 
17
  final_answer = FinalAnswer()
18
 
19
 
@@ -22,10 +32,10 @@ with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
22
 
23
  agent = CodeAgent(
24
  model=model,
25
- tools=[],
26
  managed_agents=[],
27
- max_steps=6,
28
- verbosity_level=1,
29
  grammar=None,
30
  planning_interval=None,
31
  name=None,
 
5
  # Get current directory path
6
  CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
7
 
8
+ from tools.web_search import DuckDuckGoSearchTool as WebSearch
9
+ from tools.visit_webpage import VisitWebpageTool as VisitWebpage
10
+ from tools.suggest_menu import SimpleTool as SuggestMenu
11
+ from tools.catering_service_tool import SimpleTool as CateringServiceTool
12
+ from tools.superhero_party_theme_generator import SuperheroPartyThemeTool as SuperheroPartyThemeGenerator
13
  from tools.final_answer import FinalAnswerTool as FinalAnswer
14
 
15
 
 
19
  provider=None,
20
  )
21
 
22
+ web_search = WebSearch()
23
+ visit_webpage = VisitWebpage()
24
+ suggest_menu = SuggestMenu()
25
+ catering_service_tool = CateringServiceTool()
26
+ superhero_party_theme_generator = SuperheroPartyThemeGenerator()
27
  final_answer = FinalAnswer()
28
 
29
 
 
32
 
33
  agent = CodeAgent(
34
  model=model,
35
+ tools=[web_search, visit_webpage, suggest_menu, catering_service_tool, superhero_party_theme_generator],
36
  managed_agents=[],
37
+ max_steps=10,
38
+ verbosity_level=2,
39
  grammar=None,
40
  planning_interval=None,
41
  name=None,
requirements.txt CHANGED
@@ -1 +1,4 @@
 
 
1
  smolagents
 
 
1
+ requests
2
+ markdownify
3
  smolagents
4
+ duckduckgo_search