From 096b665c0152593c19402e555c0850cdd3b2a2c0 Mon Sep 17 00:00:00 2001 From: Marco Perini Date: Wed, 15 May 2024 15:05:47 +0200 Subject: [PATCH] fix(searchgraph): used shallow copy to serialize obj --- .gitignore | 2 ++ pyproject.toml | 1 - scrapegraphai/graphs/omni_search_graph.py | 4 ++-- scrapegraphai/graphs/search_graph.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) 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 = "lorenzo.padoan977@gmail.com" } ] 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)