Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,11 +19,11 @@ def animewatcher(anime_name: str) -> str:
|
|
| 19 |
search_query = f"{anime_name} anime details"
|
| 20 |
results = duckduckgo_tool(search_query) # Fetch results from DuckDuckGo
|
| 21 |
|
| 22 |
-
# Check if results is a
|
| 23 |
-
if
|
| 24 |
-
return f"Error:
|
| 25 |
|
| 26 |
-
if not results:
|
| 27 |
return f"No results found for '{anime_name}'. Maybe it's underrated!"
|
| 28 |
|
| 29 |
# Limit results to 3 if there are more than 3
|
|
|
|
| 19 |
search_query = f"{anime_name} anime details"
|
| 20 |
results = duckduckgo_tool(search_query) # Fetch results from DuckDuckGo
|
| 21 |
|
| 22 |
+
# Check if results is a string, meaning there may be an error or no results
|
| 23 |
+
if isinstance(results, str):
|
| 24 |
+
return f"Error: The search returned a string instead of a list. Received: {results}"
|
| 25 |
|
| 26 |
+
if not isinstance(results, list) or not results:
|
| 27 |
return f"No results found for '{anime_name}'. Maybe it's underrated!"
|
| 28 |
|
| 29 |
# Limit results to 3 if there are more than 3
|