Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)->
|
| 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
|
| 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[:
|
| 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"]
|