mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-23 21:00:30 +08:00
fix(deepcopy): switch whether we have obj in the config
This commit is contained in:
parent
b4cfcb100d
commit
d4d913c8a3
@ -2,7 +2,7 @@
|
||||
OmniSearchGraph Module
|
||||
"""
|
||||
|
||||
from copy import copy
|
||||
from copy import copy, deepcopy
|
||||
|
||||
from .base_graph import BaseGraph
|
||||
from ..nodes import (
|
||||
@ -43,7 +43,11 @@ class OmniSearchGraph(AbstractGraph):
|
||||
def __init__(self, prompt: str, config: dict):
|
||||
|
||||
self.max_results = config.get("max_results", 3)
|
||||
self.copy_config = copy(config)
|
||||
|
||||
if all(isinstance(value, str) for value in config.values()):
|
||||
self.copy_config = copy(config)
|
||||
else:
|
||||
self.copy_config = deepcopy(config)
|
||||
|
||||
super().__init__(prompt, config)
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
SearchGraph Module
|
||||
"""
|
||||
|
||||
from copy import copy
|
||||
from copy import copy, deepcopy
|
||||
|
||||
from .base_graph import BaseGraph
|
||||
from ..nodes import (
|
||||
@ -42,7 +42,11 @@ class SearchGraph(AbstractGraph):
|
||||
def __init__(self, prompt: str, config: dict):
|
||||
|
||||
self.max_results = config.get("max_results", 3)
|
||||
self.copy_config = copy(config)
|
||||
|
||||
if all(isinstance(value, str) for value in config.values()):
|
||||
self.copy_config = copy(config)
|
||||
else:
|
||||
self.copy_config = deepcopy(config)
|
||||
|
||||
super().__init__(prompt, config)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user