m-ric HF staff commited on
Commit
861422e
·
verified ·
1 Parent(s): 487a7fe

Upload tool

Browse files
Files changed (4) hide show
  1. agent.json +8 -8
  2. app.py +4 -1
  3. requirements.txt +3 -3
  4. tools/visit_webpage.py +2 -2
agent.json CHANGED
@@ -36,16 +36,16 @@
36
  "description": null,
37
  "authorized_imports": [
38
  "datetime",
 
 
 
39
  "stat",
40
- "unicodedata",
41
- "pandas",
42
- "statistics",
43
  "time",
44
- "queue",
45
- "re",
46
- "itertools",
47
  "math",
48
- "random",
49
- "collections"
 
50
  ]
51
  }
 
36
  "description": null,
37
  "authorized_imports": [
38
  "datetime",
39
+ "itertools",
40
+ "collections",
41
+ "re",
42
  "stat",
43
+ "random",
 
 
44
  "time",
45
+ "unicodedata",
 
 
46
  "math",
47
+ "queue",
48
+ "pandas",
49
+ "statistics"
50
  ]
51
  }
app.py CHANGED
@@ -18,6 +18,9 @@ visit_webpage = VisitWebpageTool()
18
  final_answer = FinalAnswerTool()
19
 
20
 
 
 
 
21
  agent = CodeAgent(
22
  model=model,
23
  tools=[web_search, visit_webpage, final_answer],
@@ -27,7 +30,7 @@ agent = CodeAgent(
27
  planning_interval=None,
28
  name=None,
29
  description=None,
30
- prompt_templates=yaml.safe_load(Path("prompts.yaml").read_text()
31
  )
32
 
33
  GradioUI(agent).launch()
 
18
  final_answer = FinalAnswerTool()
19
 
20
 
21
+ with open("prompts.yaml", 'r') as stream:
22
+ prompt_templates = yaml.safe_load(stream)
23
+
24
  agent = CodeAgent(
25
  model=model,
26
  tools=[web_search, visit_webpage, final_answer],
 
30
  planning_interval=None,
31
  name=None,
32
  description=None,
33
+ prompt_templates=prompt_templates
34
  )
35
 
36
  GradioUI(agent).launch()
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- pandas
2
- smolagents
3
  markdownify
4
- requests
5
  duckduckgo_search
 
 
 
 
 
 
1
  markdownify
 
2
  duckduckgo_search
3
+ requests
4
+ smolagents
5
+ pandas
tools/visit_webpage.py CHANGED
@@ -1,8 +1,8 @@
1
  from typing import Any, Optional
2
  from smolagents.tools import Tool
3
- import markdownify
4
- import smolagents
5
  import requests
 
 
6
 
7
  class VisitWebpageTool(Tool):
8
  name = "visit_webpage"
 
1
  from typing import Any, Optional
2
  from smolagents.tools import Tool
 
 
3
  import requests
4
+ import smolagents
5
+ import markdownify
6
 
7
  class VisitWebpageTool(Tool):
8
  name = "visit_webpage"