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