abdoh-alkhateeb commited on
Commit
d74c328
1 Parent(s): a70af92

Update the way sources are passed to serper

Browse files
agents/google_serper_search_agent.py CHANGED
@@ -3,8 +3,10 @@ from langchain_community.utilities import GoogleSerperAPIWrapper
3
 
4
 
5
  class GoogleSerperSearchAgent:
6
- def __init__(self, sources: list[str]) -> None:
7
- self._sources = sources
 
 
8
  self._api = GoogleSerperAPIWrapper()
9
 
10
  def run(self, query: str, limit_per_source: int = 3) -> pd.DataFrame:
 
3
 
4
 
5
  class GoogleSerperSearchAgent:
6
+ def __init__(self, sources_path: str) -> None:
7
+ with open(sources_path) as f:
8
+ self._sources = [line.strip() for line in f.readlines()]
9
+
10
  self._api = GoogleSerperAPIWrapper()
11
 
12
  def run(self, query: str, limit_per_source: int = 3) -> pd.DataFrame: