Spaces:
Sleeping
Sleeping
Fix
Browse files
app.py
CHANGED
|
@@ -34,8 +34,8 @@ def get_fun_fact(topic: str) -> str:
|
|
| 34 |
"""
|
| 35 |
try:
|
| 36 |
search_tool = DuckDuckGoSearchTool()
|
| 37 |
-
results = search_tool.run(f"{topic} fun fact
|
| 38 |
-
if results:
|
| 39 |
fun_fact = results[0][:300]
|
| 40 |
return f"Here's a fun fact about {topic}: {fun_fact}"
|
| 41 |
else:
|
|
|
|
| 34 |
"""
|
| 35 |
try:
|
| 36 |
search_tool = DuckDuckGoSearchTool()
|
| 37 |
+
results = search_tool.run(f"{topic} fun fact")
|
| 38 |
+
if results and isinstance(results, list):
|
| 39 |
fun_fact = results[0][:300]
|
| 40 |
return f"Here's a fun fact about {topic}: {fun_fact}"
|
| 41 |
else:
|