Skip to content

Python scraper based on AI

fix(searchgraph): used shallow copy to serialize obj

Marco Perini096b665c0152
diff --git a/.gitignore b/.gitignore
index d4cc9d86..f9ce2fae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,4 +31,6 @@ examples/graph_examples/ScrapeGraphAI_generated_graph
examples/**/result.csv
examples/**/result.json
main.py
+*.python-version
+*.lock
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 53d72326..5383eac9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,7 +10,6 @@ authors = [
{ name = "Lorenzo Padoan", email = "[email protected]" }
]
dependencies = [
- # python = ">=3.9, <3.12"
"langchain==0.1.15",
"langchain-openai==0.1.6",
"langchain-google-genai==1.0.3",
diff --git a/scrapegraphai/graphs/omni_search_graph.py b/scrapegraphai/graphs/omni_search_graph.py
index 8dd5aba1..49f75c08 100644
--- a/scrapegraphai/graphs/omni_search_graph.py
+++ b/scrapegraphai/graphs/omni_search_graph.py
@@ -2,7 +2,7 @@
OmniSearchGraph Module
"""
-from copy import deepcopy
+from copy import copy
from .base_graph import BaseGraph
from ..nodes import (
@@ -43,7 +43,7 @@ class OmniSearchGraph(AbstractGraph):
def __init__(self, prompt: str, config: dict):
self.max_results = config.get("max_results", 3)
- self.copy_config = deepcopy(config)
+ self.copy_config = copy(config)
super().__init__(prompt, config)
diff --git a/scrapegraphai/graphs/search_graph.py b/scrapegraphai/graphs/search_graph.py
index 58b7069c..6a46ab91 100644
--- a/scrapegraphai/graphs/search_graph.py
+++ b/scrapegraphai/graphs/search_graph.py
@@ -2,7 +2,7 @@
SearchGraph Module
"""
-from copy import deepcopy
+from copy import copy
from .base_graph import BaseGraph
from ..nodes import (
@@ -42,7 +42,7 @@ class SearchGraph(AbstractGraph):
def __init__(self, prompt: str, config: dict):
self.max_results = config.get("max_results", 3)
- self.copy_config = deepcopy(config)
+ self.copy_config = copy(config)
super().__init__(prompt, config)