Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import yaml
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from Gradio_UI import GradioUI
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
|
@@ -34,7 +35,7 @@ def get_fun_fact(topic: str) -> str:
|
|
| 34 |
A string reporting a fun fact related to the topic or an error message.
|
| 35 |
"""
|
| 36 |
try:
|
| 37 |
-
results =
|
| 38 |
if results:
|
| 39 |
fun_fact = results[:300]
|
| 40 |
return f"Here's a fun fact about {topic}: {fun_fact}"
|
|
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from Gradio_UI import GradioUI
|
| 8 |
|
| 9 |
+
search_tool=DuckDuckGoSearchTool(max_results=1)
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
|
|
|
| 35 |
A string reporting a fun fact related to the topic or an error message.
|
| 36 |
"""
|
| 37 |
try:
|
| 38 |
+
results = search_tool.forward(query=f"{topic} fun fact")
|
| 39 |
if results:
|
| 40 |
fun_fact = results[:300]
|
| 41 |
return f"Here's a fun fact about {topic}: {fun_fact}"
|