dlaima commited on
Commit
6841b76
·
verified ·
1 Parent(s): 37a70a8

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +12 -8
tools.py CHANGED
@@ -33,20 +33,24 @@ def search_wikipedia(query: str) -> str:
33
 
34
  class WikipediaTool(Tool):
35
  def __init__(self):
36
- self.name = "WikipediaTool"
37
- self.description = "Fetches plain text from a Wikipedia article. Input should be the article title."
38
- self.inputs = {"query": "string"}
39
- super().__init__(name=self.name, description=self.description, inputs=self.inputs)
 
 
40
 
41
  def __call__(self, query: str) -> str:
42
  return fetch_wikipedia_article(query)
43
 
44
  class WikipediaSearchTool(Tool):
45
  def __init__(self):
46
- self.name = "WikipediaSearchTool"
47
- self.description = "Searches Wikipedia for article titles related to a query. Input should be a question or topic."
48
- self.inputs = {"query": "string"}
49
- super().__init__(name=self.name, description=self.description, inputs=self.inputs)
 
 
50
 
51
  def __call__(self, query: str) -> str:
52
  return search_wikipedia(query)
 
33
 
34
  class WikipediaTool(Tool):
35
  def __init__(self):
36
+ super().__init__(
37
+ name="WikipediaTool",
38
+ description="Fetches plain text from a Wikipedia article. Input should be the article title.",
39
+ inputs={"query": "string"},
40
+ output_type="string"
41
+ )
42
 
43
  def __call__(self, query: str) -> str:
44
  return fetch_wikipedia_article(query)
45
 
46
  class WikipediaSearchTool(Tool):
47
  def __init__(self):
48
+ super().__init__(
49
+ name="WikipediaSearchTool",
50
+ description="Searches Wikipedia for article titles related to a query. Input should be a question or topic.",
51
+ inputs={"query": "string"},
52
+ output_type="string"
53
+ )
54
 
55
  def __call__(self, query: str) -> str:
56
  return search_wikipedia(query)