Skip to content

Commit 8422463

Browse files
committed
feat:expose the search engine params to user
1 parent 553527a commit 8422463

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

scrapegraphai/graphs/omni_search_graph.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def _create_graph(self) -> BaseGraph:
8383
output=["urls"],
8484
node_config={
8585
"llm_model": self.llm_model,
86-
"max_results": self.max_results
86+
"max_results": self.max_results,
87+
"search_engine": self.copy_config.get("search_engine")
8788
}
8889
)
8990
graph_iterator_node = GraphIteratorNode(

scrapegraphai/graphs/search_graph.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def _create_graph(self) -> BaseGraph:
7676
output=["urls"],
7777
node_config={
7878
"llm_model": self.llm_model,
79-
"max_results": self.max_results
79+
"max_results": self.max_results,
80+
"search_engine": self.copy_config.get("search_engine")
8081
}
8182
)
8283
graph_iterator_node = GraphIteratorNode(

scrapegraphai/nodes/search_internet_node.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ def __init__(
4141
self.verbose = (
4242
False if node_config is None else node_config.get("verbose", False)
4343
)
44-
self.search_engine = node_config.get("search_engine", "google")
44+
self.search_engine = (
45+
node_config["search_engine"]
46+
if node_config.get("search_engine")
47+
else "google"
48+
)
4549
self.max_results = node_config.get("max_results", 3)
4650

4751
def execute(self, state: dict) -> dict:

0 commit comments

Comments
 (0)