huggingsamurai commited on
Commit
b4d3934
·
verified ·
1 Parent(s): 62e5d21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,9 +9,9 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def my_custom_tool(arg1:str)-> list[str]: #it's import to specify the return type
13
  #Keep this format for the description / args / args description but feel free to modify the tool
14
- """A tool that retrieves a list of top 10 books from gutenberg.org
15
  Args:
16
  arg1:str A keyword like technology or science in string representation
17
  """
@@ -35,7 +35,7 @@ def my_custom_tool(arg1:str)-> list[str]: #it's import to specify the return typ
35
  soup = BeautifulSoup(response.content, "html.parser")
36
  results = soup.find_all("li", class_="booklink")
37
  urls = []
38
- for result in results[:10]: # grabs the top 10
39
  link = result.find("a", class_="link")
40
  if link:
41
  full_url = "https://www.gutenberg.org" + link["href"]
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def my_custom_tool(arg1:str)-> str: #it's import to specify the return type
13
  #Keep this format for the description / args / args description but feel free to modify the tool
14
+ """A tool that retrieves a list of top book from gutenberg.org
15
  Args:
16
  arg1:str A keyword like technology or science in string representation
17
  """
 
35
  soup = BeautifulSoup(response.content, "html.parser")
36
  results = soup.find_all("li", class_="booklink")
37
  urls = []
38
+ for result in results[:1]: # grabs the top 1
39
  link = result.find("a", class_="link")
40
  if link:
41
  full_url = "https://www.gutenberg.org" + link["href"]