Spaces:
Sleeping
Sleeping
removed wiki search
Browse files
tools.py
CHANGED
@@ -15,24 +15,24 @@ def web_search(query: str) -> str:
|
|
15 |
"""
|
16 |
return search.run(query)
|
17 |
|
18 |
-
@tool
|
19 |
-
def wiki_search(query: str) -> str:
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
|
38 |
-
tools = [web_search
|
|
|
15 |
"""
|
16 |
return search.run(query)
|
17 |
|
18 |
+
# @tool
|
19 |
+
# def wiki_search(query: str) -> str:
|
20 |
+
# """
|
21 |
+
# Looks up a topic on English Wikipedia and returns a summary.
|
22 |
+
# Args:
|
23 |
+
# query (str): The search query.
|
24 |
+
# Returns:
|
25 |
+
# str: A concise summary of the topic from English Wikipedia.
|
26 |
+
# """
|
27 |
+
# try:
|
28 |
+
# page = wikipedia.page(query)
|
29 |
+
# print(f"query: {query}, summary: {page.summary}")
|
30 |
+
# return page.summary
|
31 |
+
# except wikipedia.DisambiguationError as e:
|
32 |
+
# return f"Disambiguation: {', '.join(e.options[:5])}"
|
33 |
+
# except wikipedia.PageError:
|
34 |
+
# return "Page not found."
|
35 |
+
# except Exception as e:
|
36 |
+
# return f"Error: {e}"
|
37 |
|
38 |
+
tools = [web_search]
|