Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,23 +21,20 @@ from wikipedia_searcher import WikipediaSearcher
|
|
21 |
#)
|
22 |
|
23 |
|
24 |
-
|
25 |
class WikipediaSearchTool(Tool):
|
|
|
|
|
|
|
|
|
|
|
26 |
def __init__(self):
|
27 |
-
super().__init__(
|
28 |
-
name="wikipedia_search",
|
29 |
-
description="Search Wikipedia for a given query.",
|
30 |
-
inputs={"query": "string"},
|
31 |
-
output_type="string",
|
32 |
-
)
|
33 |
self.searcher = WikipediaSearcher()
|
34 |
|
35 |
def __call__(self, inputs: dict) -> str:
|
36 |
query = inputs.get("query", "")
|
37 |
return self.searcher.search(query)
|
38 |
|
39 |
-
wikipedia_search_tool = WikipediaSearchTool()
|
40 |
-
|
41 |
|
42 |
# Define the system prompt
|
43 |
SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question.
|
|
|
21 |
#)
|
22 |
|
23 |
|
|
|
24 |
class WikipediaSearchTool(Tool):
|
25 |
+
name = "wikipedia_search"
|
26 |
+
description = "Search Wikipedia for a given query."
|
27 |
+
inputs = {"query": "string"}
|
28 |
+
output_type = "string"
|
29 |
+
|
30 |
def __init__(self):
|
31 |
+
super().__init__()
|
|
|
|
|
|
|
|
|
|
|
32 |
self.searcher = WikipediaSearcher()
|
33 |
|
34 |
def __call__(self, inputs: dict) -> str:
|
35 |
query = inputs.get("query", "")
|
36 |
return self.searcher.search(query)
|
37 |
|
|
|
|
|
38 |
|
39 |
# Define the system prompt
|
40 |
SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question.
|