Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
@@ -15,9 +16,9 @@ def online_search(query:str)-> list: #it's import to specify the return type
|
|
| 15 |
Args:
|
| 16 |
query: the user message
|
| 17 |
"""
|
| 18 |
-
with
|
| 19 |
-
|
| 20 |
-
|
| 21 |
return [
|
| 22 |
{
|
| 23 |
"title": result["title"],
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
from duckduckgo_search import DDGS
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
| 16 |
Args:
|
| 17 |
query: the user message
|
| 18 |
"""
|
| 19 |
+
with DDGS() as ddgs:
|
| 20 |
+
results = ddgs.text(query, max_results=5)
|
| 21 |
+
|
| 22 |
return [
|
| 23 |
{
|
| 24 |
"title": result["title"],
|