qdqd commited on
Commit
b130120
Β·
verified Β·
1 Parent(s): f8ba1d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -20,6 +20,7 @@ from scripts.run_agents import (
20
  get_zip_description,
21
  )
22
  from scripts.text_inspector_tool import TextInspectorTool
 
23
  from scripts.text_web_browser import (
24
  ArchiveSearchTool,
25
  FinderTool,
@@ -120,12 +121,14 @@ text_limit = 20000
120
  ti_tool = TextInspectorTool(model, text_limit)
121
  browser = SimpleTextBrowser(**BROWSER_CONFIG)
122
 
123
- class DuckDuckGoSearchTool:
 
124
  """Search tool using DuckDuckGo"""
125
  name = "web_search"
126
  description = "Search the web using DuckDuckGo (current information)"
127
 
128
  def __init__(self, max_results: int = 5):
 
129
  self.max_results = max_results
130
 
131
  def run(self, query: str) -> str:
 
20
  get_zip_description,
21
  )
22
  from scripts.text_inspector_tool import TextInspectorTool
23
+ from smolagents.tools import Tool
24
  from scripts.text_web_browser import (
25
  ArchiveSearchTool,
26
  FinderTool,
 
121
  ti_tool = TextInspectorTool(model, text_limit)
122
  browser = SimpleTextBrowser(**BROWSER_CONFIG)
123
 
124
+
125
+ class DuckDuckGoSearchTool(Tool): # Inherit from base Tool class
126
  """Search tool using DuckDuckGo"""
127
  name = "web_search"
128
  description = "Search the web using DuckDuckGo (current information)"
129
 
130
  def __init__(self, max_results: int = 5):
131
+ super().__init__()
132
  self.max_results = max_results
133
 
134
  def run(self, query: str) -> str: