Aakash010 commited on
Commit
ccaa451
·
verified ·
1 Parent(s): 23554eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -37,11 +37,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
37
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
38
 
39
 
40
- web_search_tool = DuckDuckGoSearchTool(max_results=5,query)
41
- """A tool that lets you search on the internet .
42
- Args:
43
- max_results: Maximum number of search results to return.
44
- query : Query to be searched"""
 
 
 
45
 
46
 
47
  final_answer = FinalAnswerTool()
@@ -65,7 +68,7 @@ with open("prompts.yaml", 'r') as stream:
65
 
66
  agent = CodeAgent(
67
  model=model,
68
- tools=[final_answer,my_custom_tool,get_current_time_in_timezone,search], ## add your tools here (don't remove final answer)
69
  max_steps=6,
70
  verbosity_level=1,
71
  grammar=None,
 
37
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
38
 
39
 
40
+ web_search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
41
+ @tool
42
+ def results(arg1:str)-> str:
43
+ """A tool that fetches Information from the Internet.
44
+ Args:
45
+ arg1: A string of text to be searcehd on the internet.
46
+ """
47
+ return web_search_tool(arg1)
48
 
49
 
50
  final_answer = FinalAnswerTool()
 
68
 
69
  agent = CodeAgent(
70
  model=model,
71
+ tools=[final_answer,my_custom_tool,get_current_time_in_timezone,results,DuckDuckGoSearchTool], ## add your tools here (don't remove final answer)
72
  max_steps=6,
73
  verbosity_level=1,
74
  grammar=None,