22CSVScraperMultiGraph Module
33"""
44
5+ from copy import deepcopy
56from typing import List , Optional
67from pydantic import BaseModel
78from .base_graph import BaseGraph
@@ -48,6 +49,8 @@ def __init__(self, prompt: str, source: List[str],
4849
4950 self .copy_config = safe_deepcopy (config )
5051
52+ self .copy_schema = deepcopy (schema )
53+
5154 super ().__init__ (prompt , config , source , schema )
5255
5356 def _create_graph (self ) -> BaseGraph :
@@ -58,17 +61,18 @@ def _create_graph(self) -> BaseGraph:
5861 BaseGraph: A graph instance representing the web scraping and searching workflow.
5962 """
6063
61- smart_scraper_instance = CSVScraperGraph (
62- prompt = "" ,
63- source = "" ,
64- config = self .copy_config ,
65- )
64+ # smart_scraper_instance = CSVScraperGraph(
65+ # prompt="",
66+ # source="",
67+ # config=self.copy_config,
68+ # )
6669
6770 graph_iterator_node = GraphIteratorNode (
6871 input = "user_prompt & jsons" ,
6972 output = ["results" ],
7073 node_config = {
71- "graph_instance" : smart_scraper_instance ,
74+ "graph_instance" : CSVScraperGraph ,
75+ "scraper_config" : self .copy_config ,
7276 }
7377 )
7478
@@ -77,7 +81,7 @@ def _create_graph(self) -> BaseGraph:
7781 output = ["answer" ],
7882 node_config = {
7983 "llm_model" : self .llm_model ,
80- "schema" : self .schema
84+ "schema" : self .copy_schema
8185 }
8286 )
8387
0 commit comments