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 2
2
OmniSearchGraph Module
3
3
"""
4
4
5
- from copy import copy
5
+ from copy import copy , deepcopy
6
6
7
7
from .base_graph import BaseGraph
8
8
from ..nodes import (
@@ -43,7 +43,11 @@ class OmniSearchGraph(AbstractGraph):
43
43
def __init__ (self , prompt : str , config : dict ):
44
44
45
45
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 )
47
51
48
52
super ().__init__ (prompt , config )
49
53
Original file line number Diff line number Diff line change 2
2
SearchGraph Module
3
3
"""
4
4
5
- from copy import copy
5
+ from copy import copy , deepcopy
6
6
7
7
from .base_graph import BaseGraph
8
8
from ..nodes import (
@@ -42,7 +42,11 @@ class SearchGraph(AbstractGraph):
42
42
def __init__ (self , prompt : str , config : dict ):
43
43
44
44
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 )
46
50
47
51
super ().__init__ (prompt , config )
48
52
You can’t perform that action at this time.
0 commit comments