Spaces:
Sleeping
Sleeping
update app.py to make sure the indents are right
Browse files
app.py
CHANGED
|
@@ -21,9 +21,9 @@ def celebrity_finder(name:str)-> str: #it's import to specify the return type
|
|
| 21 |
results = self.search_tool.query(query)
|
| 22 |
|
| 23 |
# Step 1: Get first search result (hopefully Wikipedia)
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
# Step 2: Fetch the Wikipedia page
|
| 29 |
try:
|
|
|
|
| 21 |
results = self.search_tool.query(query)
|
| 22 |
|
| 23 |
# Step 1: Get first search result (hopefully Wikipedia)
|
| 24 |
+
wiki_url = results[0].get("href")
|
| 25 |
+
if not wiki_url or "wikipedia.org" not in wiki_url:
|
| 26 |
+
return f"No Wikipedia link found in top results for {celebrity_name}."
|
| 27 |
|
| 28 |
# Step 2: Fetch the Wikipedia page
|
| 29 |
try:
|