File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 22OmniSearchGraph Module
33"""
44
5- from copy import copy
5+ from copy import copy , deepcopy
66
77from .base_graph import BaseGraph
88from ..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
Original file line number Diff line number Diff line change 22SearchGraph Module
33"""
44
5- from copy import copy
5+ from copy import copy , deepcopy
66
77from .base_graph import BaseGraph
88from ..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
You can’t perform that action at this time.
0 commit comments