Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -33,20 +33,24 @@ def search_wikipedia(query: str) -> str:
|
|
| 33 |
|
| 34 |
class WikipediaTool(Tool):
|
| 35 |
def __init__(self):
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
|
| 41 |
def __call__(self, query: str) -> str:
|
| 42 |
return fetch_wikipedia_article(query)
|
| 43 |
|
| 44 |
class WikipediaSearchTool(Tool):
|
| 45 |
def __init__(self):
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
| 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)
|