Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -35,8 +35,8 @@ 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 =
|
| 39 |
-
super().__init__(name=self.name, description=self.description)
|
| 40 |
|
| 41 |
def __call__(self, query: str) -> str:
|
| 42 |
return fetch_wikipedia_article(query)
|
|
@@ -45,8 +45,8 @@ 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 =
|
| 49 |
-
super().__init__(name=self.name, description=self.description)
|
| 50 |
|
| 51 |
def __call__(self, query: str) -> str:
|
| 52 |
return search_wikipedia(query)
|
|
|
|
| 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)
|
|
|
|
| 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)
|