Skip to content

Commit d4d913c

Browse files
committed
fix(deepcopy): switch whether we have obj in the config
1 parent b4cfcb1 commit d4d913c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

scrapegraphai/graphs/omni_search_graph.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
OmniSearchGraph Module
33
"""
44

5-
from copy import copy
5+
from copy import copy, deepcopy
66

77
from .base_graph import BaseGraph
88
from ..nodes import (
@@ -43,7 +43,11 @@ class OmniSearchGraph(AbstractGraph):
4343
def __init__(self, prompt: str, config: dict):
4444

4545
self.max_results = config.get("max_results", 3)
46-
self.copy_config = copy(config)
46+
47+
if all(isinstance(value, str) for value in config.values()):
48+
self.copy_config = copy(config)
49+
else:
50+
self.copy_config = deepcopy(config)
4751

4852
super().__init__(prompt, config)
4953

scrapegraphai/graphs/search_graph.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SearchGraph Module
33
"""
44

5-
from copy import copy
5+
from copy import copy, deepcopy
66

77
from .base_graph import BaseGraph
88
from ..nodes import (
@@ -42,7 +42,11 @@ class SearchGraph(AbstractGraph):
4242
def __init__(self, prompt: str, config: dict):
4343

4444
self.max_results = config.get("max_results", 3)
45-
self.copy_config = copy(config)
45+
46+
if all(isinstance(value, str) for value in config.values()):
47+
self.copy_config = copy(config)
48+
else:
49+
self.copy_config = deepcopy(config)
4650

4751
super().__init__(prompt, config)
4852

0 commit comments

Comments
 (0)