Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,9 +14,10 @@ def wiki_of_person(name_of_person:str) -> str:
|
|
| 14 |
Args:
|
| 15 |
name_of_person: The name of the person to look up for in wikipedia
|
| 16 |
"""
|
|
|
|
| 17 |
# Use DuckDuckGoSearchTool to search for the wikipedia url of the person and then visit the url
|
| 18 |
query = f"{name_of_person} wikipedia"
|
| 19 |
-
wikipedia_url =
|
| 20 |
# Use the wikipedia url to get the person's description, location, and interesting facts
|
| 21 |
wikipedia_results = visit_url(url=wikipedia_url)
|
| 22 |
return f"Detailes description: {wikipedia_results['description']}, Location: {wikipedia_results['location']}, Interesting facts: {wikipedia_results['interesting facts']}"
|
|
|
|
| 14 |
Args:
|
| 15 |
name_of_person: The name of the person to look up for in wikipedia
|
| 16 |
"""
|
| 17 |
+
search_tool = DuckDuckGoSearchTool()
|
| 18 |
# Use DuckDuckGoSearchTool to search for the wikipedia url of the person and then visit the url
|
| 19 |
query = f"{name_of_person} wikipedia"
|
| 20 |
+
wikipedia_url = search_tool(query)
|
| 21 |
# Use the wikipedia url to get the person's description, location, and interesting facts
|
| 22 |
wikipedia_results = visit_url(url=wikipedia_url)
|
| 23 |
return f"Detailes description: {wikipedia_results['description']}, Location: {wikipedia_results['location']}, Interesting facts: {wikipedia_results['interesting facts']}"
|