Freddolin commited on
Commit
7c3b683
·
verified ·
1 Parent(s): ba20595

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +2 -2
agent.py CHANGED
@@ -6,7 +6,7 @@ from transformers import (
6
  AutoProcessor,
7
  AutoModelForSpeechSeq2Seq
8
  )
9
- from ddgs import DDGS
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 = list(ddgs.text(query, safesearch="off"))
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: