Thanh Vinh Vo commited on
Commit
9dd14b0
·
1 Parent(s): f45d60f
Files changed (2) hide show
  1. app.py +2 -13
  2. requirements.txt +1 -1
app.py CHANGED
@@ -20,17 +20,6 @@ from smolagents import (
20
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
21
 
22
 
23
- @tool
24
- def to_markdown(arg1: str) -> str: # it's important to specify the return type
25
- """A tool that converts HTML to Markdown.
26
- Args:
27
- arg1: the raw HTML string to convert
28
- """
29
- from html_to_markdown import convert_to_markdown
30
-
31
- return convert_to_markdown(arg1)
32
-
33
-
34
  # --- Basic Agent Definition ---
35
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
36
  class BasicAgent:
@@ -38,9 +27,9 @@ class BasicAgent:
38
  print("BasicAgent initialized.")
39
 
40
  self.agent = CodeAgent(
41
- tools=[DuckDuckGoSearchTool(), VisitWebpageTool(), to_markdown],
42
  model=InferenceClientModel(),
43
- additional_authorized_imports=["requests", "bs4", "html_to_markdown"],
44
  max_steps=10,
45
  )
46
 
 
20
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
21
 
22
 
 
 
 
 
 
 
 
 
 
 
 
23
  # --- Basic Agent Definition ---
24
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
25
  class BasicAgent:
 
27
  print("BasicAgent initialized.")
28
 
29
  self.agent = CodeAgent(
30
+ tools=[DuckDuckGoSearchTool(), VisitWebpageTool()],
31
  model=InferenceClientModel(),
32
+ additional_authorized_imports=["requests", "bs4"],
33
  max_steps=10,
34
  )
35
 
requirements.txt CHANGED
@@ -3,4 +3,4 @@ requests
3
  smolagents
4
  duckduckgo_search
5
  bs4
6
- html-to-markdown
 
3
  smolagents
4
  duckduckgo_search
5
  bs4
6
+ markdownify