mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-28 21:01:55 +08:00
feat: add copy for smart_scraper_multi_concat
This commit is contained in:
parent
2ae26e96a0
commit
9e3171b9fa
@ -61,12 +61,6 @@ class CSVScraperMultiGraph(AbstractGraph):
|
||||
BaseGraph: A graph instance representing the web scraping and searching workflow.
|
||||
"""
|
||||
|
||||
# smart_scraper_instance = CSVScraperGraph(
|
||||
# prompt="",
|
||||
# source="",
|
||||
# config=self.copy_config,
|
||||
# )
|
||||
|
||||
graph_iterator_node = GraphIteratorNode(
|
||||
input="user_prompt & jsons",
|
||||
output=["results"],
|
||||
|
||||
@ -61,13 +61,6 @@ class JSONScraperMultiGraph(AbstractGraph):
|
||||
BaseGraph: A graph instance representing the web scraping and searching workflow.
|
||||
"""
|
||||
|
||||
# smart_scraper_instance = JSONScraperGraph(
|
||||
# prompt="",
|
||||
# source="",
|
||||
# config=self.copy_config,
|
||||
# schema=self.copy_schema
|
||||
# )
|
||||
|
||||
graph_iterator_node = GraphIteratorNode(
|
||||
input="user_prompt & jsons",
|
||||
output=["results"],
|
||||
|
||||
@ -55,14 +55,7 @@ class MDScraperMultiGraph(AbstractGraph):
|
||||
Returns:
|
||||
BaseGraph: A graph instance representing the web scraping and searching workflow.
|
||||
"""
|
||||
# smart_scraper_instance = MDScraperGraph(
|
||||
# prompt="",
|
||||
# source="",
|
||||
# config=self.copy_config,
|
||||
# schema=self.copy_schema
|
||||
# )
|
||||
|
||||
# Define the graph nodes
|
||||
graph_iterator_node = GraphIteratorNode(
|
||||
input="user_prompt & jsons",
|
||||
output=["results"],
|
||||
|
||||
@ -59,13 +59,6 @@ class PdfScraperMultiGraph(AbstractGraph):
|
||||
BaseGraph: A graph instance representing the web scraping and searching workflow.
|
||||
"""
|
||||
|
||||
# pdf_scraper_instance = PDFScraperGraph(
|
||||
# prompt="",
|
||||
# source="",
|
||||
# config=self.copy_config,
|
||||
# schema=self.copy_schema
|
||||
# )
|
||||
|
||||
graph_iterator_node = GraphIteratorNode(
|
||||
input="user_prompt & pdfs",
|
||||
output=["results"],
|
||||
|
||||
@ -2,18 +2,17 @@
|
||||
SmartScraperMultiGraph Module
|
||||
"""
|
||||
|
||||
from copy import copy, deepcopy
|
||||
from copy import deepcopy
|
||||
from typing import List, Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
from .base_graph import BaseGraph
|
||||
from .abstract_graph import AbstractGraph
|
||||
from .smart_scraper_graph import SmartScraperGraph
|
||||
|
||||
from ..nodes import (
|
||||
GraphIteratorNode,
|
||||
ConcatAnswersNode
|
||||
)
|
||||
from ..utils.copy import safe_deepcopy
|
||||
|
||||
|
||||
class SmartScraperMultiConcatGraph(AbstractGraph):
|
||||
@ -46,11 +45,8 @@ class SmartScraperMultiConcatGraph(AbstractGraph):
|
||||
|
||||
def __init__(self, prompt: str, source: List[str],
|
||||
config: dict, schema: Optional[BaseModel] = None):
|
||||
|
||||
if all(isinstance(value, str) for value in config.values()):
|
||||
self.copy_config = copy(config)
|
||||
else:
|
||||
self.copy_config = deepcopy(config)
|
||||
|
||||
self.copy_config = safe_deepcopy(config)
|
||||
|
||||
self.copy_schema = deepcopy(schema)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user