Davit6174 commited on
Commit
795b59a
·
verified ·
1 Parent(s): f654336

removed wiki search

Browse files
Files changed (1) hide show
  1. tools.py +20 -20
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
- 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, wiki_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]