Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -59,11 +59,12 @@ def wikipedia_search_tool(query: str) -> str:
|
|
| 59 |
query: The query to search in wikipedia
|
| 60 |
|
| 61 |
Example:
|
| 62 |
-
|
|
|
|
| 63 |
"""
|
| 64 |
try:
|
| 65 |
page_title = wikipedia.search(query)[0]
|
| 66 |
summary = wikipedia.summary(page_title, sentences=5)
|
| 67 |
-
return f"
|
| 68 |
except Exception as e:
|
| 69 |
return f"Error: {str(e)}"
|
|
|
|
| 59 |
query: The query to search in wikipedia
|
| 60 |
|
| 61 |
Example:
|
| 62 |
+
{"message": "How many albums did the Beatles produce between 1965 and 1968?"}
|
| 63 |
+
wikipedia_search_tool("The Beatles")
|
| 64 |
"""
|
| 65 |
try:
|
| 66 |
page_title = wikipedia.search(query)[0]
|
| 67 |
summary = wikipedia.summary(page_title, sentences=5)
|
| 68 |
+
return f"Title: {page.title}\n\n{page.content}"
|
| 69 |
except Exception as e:
|
| 70 |
return f"Error: {str(e)}"
|