Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -6,7 +6,7 @@ from transformers import (
|
|
| 6 |
AutoProcessor,
|
| 7 |
AutoModelForSpeechSeq2Seq
|
| 8 |
)
|
| 9 |
-
from
|
| 10 |
import pandas as pd
|
| 11 |
import os
|
| 12 |
|
|
@@ -37,7 +37,7 @@ class GaiaAgent:
|
|
| 37 |
def search(self, query: str) -> str:
|
| 38 |
try:
|
| 39 |
with DDGS() as ddgs:
|
| 40 |
-
results =
|
| 41 |
if results:
|
| 42 |
return results[0]['body']
|
| 43 |
except Exception:
|
|
|
|
| 6 |
AutoProcessor,
|
| 7 |
AutoModelForSpeechSeq2Seq
|
| 8 |
)
|
| 9 |
+
from duckduckgo_search import DDGS
|
| 10 |
import pandas as pd
|
| 11 |
import os
|
| 12 |
|
|
|
|
| 37 |
def search(self, query: str) -> str:
|
| 38 |
try:
|
| 39 |
with DDGS() as ddgs:
|
| 40 |
+
results = ddgs.text("your query", max_results=1)
|
| 41 |
if results:
|
| 42 |
return results[0]['body']
|
| 43 |
except Exception:
|