Gas96 commited on
Commit
3acd509
·
verified ·
1 Parent(s): b97b913
Files changed (1) hide show
  1. app.py +2 -2
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 site:wikipedia.org")
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: