Spaces:
Sleeping
Sleeping
Update wikipediaLookup.py
Browse files- wikipediaLookup.py +5 -2
wikipediaLookup.py
CHANGED
@@ -14,7 +14,7 @@ class WikipediaLookupTool(Tool):
|
|
14 |
output_type = "string"
|
15 |
|
16 |
|
17 |
-
def
|
18 |
try:
|
19 |
page = wikipedia.page(query)
|
20 |
return page.content # full text
|
@@ -23,4 +23,7 @@ class WikipediaLookupTool(Tool):
|
|
23 |
except wikipedia.PageError:
|
24 |
return f"Page not found for: {query}"
|
25 |
except Exception as e:
|
26 |
-
return f"Unexpected error: {e}"
|
|
|
|
|
|
|
|
14 |
output_type = "string"
|
15 |
|
16 |
|
17 |
+
def forward(self, query: str) -> str:
|
18 |
try:
|
19 |
page = wikipedia.page(query)
|
20 |
return page.content # full text
|
|
|
23 |
except wikipedia.PageError:
|
24 |
return f"Page not found for: {query}"
|
25 |
except Exception as e:
|
26 |
+
return f"Unexpected error: {e}"
|
27 |
+
|
28 |
+
def __init__(self, *args, **kwargs):
|
29 |
+
self.is_initialized = False
|