andreagemelli
commited on
Commit
·
068055e
1
Parent(s):
d18f44e
[fix] tool docstring correction
Browse files
app.py
CHANGED
@@ -6,12 +6,11 @@ from urllib.request import urlopen
|
|
6 |
|
7 |
from Gradio_UI import GradioUI
|
8 |
|
9 |
-
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
10 |
@tool
|
11 |
def grandma_secret_sauce(url: str) -> str:
|
12 |
"""This tool look at the url provided and returns the recipe from the page.
|
13 |
Args:
|
14 |
-
url
|
15 |
"""
|
16 |
html = urlopen(url).read().decode("utf-8")
|
17 |
scraper = scrape_html(html, org_url=url)
|
@@ -22,7 +21,7 @@ def grandma_secret_sauce(url: str) -> str:
|
|
22 |
Ingredients: {scraper.ingredients()}
|
23 |
Instructions: {scraper.instructions()}
|
24 |
"""
|
25 |
-
|
26 |
return recipe
|
27 |
|
28 |
final_answer = FinalAnswerTool()
|
@@ -42,7 +41,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
42 |
|
43 |
agent = CodeAgent(
|
44 |
model=model,
|
45 |
-
tools=[final_answer, DuckDuckGoSearchTool()],
|
46 |
max_steps=6,
|
47 |
verbosity_level=1,
|
48 |
grammar=None,
|
|
|
6 |
|
7 |
from Gradio_UI import GradioUI
|
8 |
|
|
|
9 |
@tool
|
10 |
def grandma_secret_sauce(url: str) -> str:
|
11 |
"""This tool look at the url provided and returns the recipe from the page.
|
12 |
Args:
|
13 |
+
url: The url of the page to scrape.
|
14 |
"""
|
15 |
html = urlopen(url).read().decode("utf-8")
|
16 |
scraper = scrape_html(html, org_url=url)
|
|
|
21 |
Ingredients: {scraper.ingredients()}
|
22 |
Instructions: {scraper.instructions()}
|
23 |
"""
|
24 |
+
|
25 |
return recipe
|
26 |
|
27 |
final_answer = FinalAnswerTool()
|
|
|
41 |
|
42 |
agent = CodeAgent(
|
43 |
model=model,
|
44 |
+
tools=[final_answer, DuckDuckGoSearchTool(), grandma_secret_sauce],
|
45 |
max_steps=6,
|
46 |
verbosity_level=1,
|
47 |
grammar=None,
|