Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -38,19 +38,20 @@ def search_wikipedia(query: str) -> str:
|
|
| 38 |
return "No search results found."
|
| 39 |
|
| 40 |
class WikipediaTool(Tool):
|
| 41 |
-
description = "Fetches plain text from a Wikipedia article. Input should be the article title."
|
| 42 |
-
|
| 43 |
def __init__(self):
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
|
| 46 |
def __call__(self, query: str) -> str:
|
| 47 |
return fetch_wikipedia_article(query)
|
| 48 |
|
| 49 |
class WikipediaSearchTool(Tool):
|
| 50 |
-
description = "Searches Wikipedia for article titles related to a query. Input should be a question or topic."
|
| 51 |
-
|
| 52 |
def __init__(self):
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
|
| 55 |
def __call__(self, query: str) -> str:
|
| 56 |
return search_wikipedia(query)
|
|
|
|
|
|
| 38 |
return "No search results found."
|
| 39 |
|
| 40 |
class WikipediaTool(Tool):
|
|
|
|
|
|
|
| 41 |
def __init__(self):
|
| 42 |
+
self.name = "WikipediaTool"
|
| 43 |
+
self.description = "Fetches plain text from a Wikipedia article. Input should be the article title."
|
| 44 |
+
super().__init__(name=self.name, description=self.description)
|
| 45 |
|
| 46 |
def __call__(self, query: str) -> str:
|
| 47 |
return fetch_wikipedia_article(query)
|
| 48 |
|
| 49 |
class WikipediaSearchTool(Tool):
|
|
|
|
|
|
|
| 50 |
def __init__(self):
|
| 51 |
+
self.name = "WikipediaSearchTool"
|
| 52 |
+
self.description = "Searches Wikipedia for article titles related to a query. Input should be a question or topic."
|
| 53 |
+
super().__init__(name=self.name, description=self.description)
|
| 54 |
|
| 55 |
def __call__(self, query: str) -> str:
|
| 56 |
return search_wikipedia(query)
|
| 57 |
+
|