ChIrish06 commited on
Commit
a026291
·
verified ·
1 Parent(s): 7f95535

Update app.py

Browse files

Adding appropriate docstring info for somalagent

Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -28,6 +28,7 @@ def webpage_contents_get(url:str, headers_in: dict = None)-> str: #it's import t
28
  """A simple function to grab contents of a webpage
29
  Args:
30
  url: The URL the contents of which the tool will get
 
31
  """
32
  response = requests.get(url, headers = headers_in)
33
  #html_content = response.text
@@ -36,7 +37,7 @@ def webpage_contents_get(url:str, headers_in: dict = None)-> str: #it's import t
36
  @tool
37
  def webpage_header_get(url:str)-> str: #it's import to specify the return type
38
  #Keep this format for the description / args / args description but feel free to modify the tool
39
- """A simple function to grab header of a webpage
40
  Args:
41
  url: The URL the contents of which the tool will get
42
  """
@@ -97,7 +98,8 @@ with open("prompts.yaml", 'r') as stream:
97
 
98
  agent = CodeAgent(
99
  model=model,
100
- tools=[final_answer, image_generation_tool,webpage_contents_get], ## add your tools here (don't remove final answer)
 
101
  max_steps=6,
102
  verbosity_level=1,
103
  grammar=None,
 
28
  """A simple function to grab contents of a webpage
29
  Args:
30
  url: The URL the contents of which the tool will get
31
+ headers_in: A dictionary which defines the headers for the request. Defaults to None
32
  """
33
  response = requests.get(url, headers = headers_in)
34
  #html_content = response.text
 
37
  @tool
38
  def webpage_header_get(url:str)-> str: #it's import to specify the return type
39
  #Keep this format for the description / args / args description but feel free to modify the tool
40
+ """A simple function to grab header of a webpage. Can be passed into webpage_contents_get if desired.
41
  Args:
42
  url: The URL the contents of which the tool will get
43
  """
 
98
 
99
  agent = CodeAgent(
100
  model=model,
101
+ tools=[final_answer, image_generation_tool,webpage_contents_get,
102
+ webpage_header_get, webpage_contents_soup_links], ## add your tools here (don't remove final answer)
103
  max_steps=6,
104
  verbosity_level=1,
105
  grammar=None,