Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -32,25 +32,19 @@ def search_wikipedia(query: str) -> str:
|
|
| 32 |
return "No search results found."
|
| 33 |
|
| 34 |
class WikipediaTool(Tool):
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 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 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
inputs={"query": "string"},
|
| 52 |
-
output_type="string"
|
| 53 |
-
)
|
| 54 |
|
| 55 |
def __call__(self, query: str) -> str:
|
| 56 |
return search_wikipedia(query)
|
|
|
|
| 32 |
return "No search results found."
|
| 33 |
|
| 34 |
class WikipediaTool(Tool):
|
| 35 |
+
name = "WikipediaTool"
|
| 36 |
+
description = "Fetches plain text from a Wikipedia article. Input should be the article title."
|
| 37 |
+
inputs = {"query": "string"}
|
| 38 |
+
output_type = "string"
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
def __call__(self, query: str) -> str:
|
| 41 |
return fetch_wikipedia_article(query)
|
| 42 |
|
| 43 |
class WikipediaSearchTool(Tool):
|
| 44 |
+
name = "WikipediaSearchTool"
|
| 45 |
+
description = "Searches Wikipedia for article titles related to a query. Input should be a question or topic."
|
| 46 |
+
inputs = {"query": "string"}
|
| 47 |
+
output_type = "string"
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
def __call__(self, query: str) -> str:
|
| 50 |
return search_wikipedia(query)
|