Python scraper based on AI
Python ai-crawlerai-scrapingai-searchcrawlerdata-extractionfirecrawl-alternativelarge-language-modelllmmarkdownragscrapingscraping-pythonweb-crawlerweb-crawlersweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Merge branch 'pre/beta' into fix-GenerateScraperGraph
Eric Page0683e78e7867
diff --cc examples/openai/script_generator_openai.pyindex 78750a37,03edcdd7..14c00ab4--- a/examples/openai/script_generator_openai.py+++ b/examples/openai/script_generator_openai.py@@@ -41,5 -41,6 +41,6 @@@ print(result# Get graph execution info# ************************************************-graph_exec_info = smart_scraper_graph.get_execution_info()+graph_exec_info = script_creator_graph.get_execution_info()print(prettify_exec_info(graph_exec_info))+diff --cc scrapegraphai/graphs/script_creator_graph.pyindex 94752396,29798d0d..eafe4057--- a/scrapegraphai/graphs/script_creator_graph.py+++ b/scrapegraphai/graphs/script_creator_graph.py@@@ -69,15 -66,20 +65,14 @@@ class ScriptCreatorGraph(AbstractGraph)input="doc",output=["parsed_doc"],node_config={"chunk_size": self.model_token,+ "verbose": self.verbose,+ "parse_html": False})- rag_node = RAGNode(- input="user_prompt & (parsed_doc | doc)",- output=["relevant_chunks"],- node_config={- "llm_model": self.llm_model,- "embedder_model": self.embedder_model- }- )generate_scraper_node = GenerateScraperNode(- input="user_prompt & (relevant_chunks | parsed_doc | doc)",+ input="user_prompt & (doc)",output=["answer"],- node_config={"llm": self.llm_model,- "verbose": self.verbose},+ node_config={"llm_model": self.llm_model},library=self.library,website=self.source)diff --cc scrapegraphai/nodes/generate_scraper_node.pyindex e744d0c6,e909a15c..804635de--- a/scrapegraphai/nodes/generate_scraper_node.py+++ b/scrapegraphai/nodes/generate_scraper_node.py@@@ -36,13 -36,15 +36,15 @@@ class GenerateScraperNode(BaseNode)"""- def __init__(self, input: str, output: List[str], node_config: dict,- library: str, website: str, node_name: str = "GenerateScraper"):- def __init__(self, input: str, output: List[str], library: str, website: str,- node_config: Optional[dict]=None, node_name: str = "GenerateAnswer"):++ def __init__(self, input: str, output: List[str], library: str, website: str,++ node_config: Optional[dict]=None, node_name: str = "GenerateScraper"):super().__init__(node_name, "node", input, output, 2, node_config)- self.llm_model = node_config["llm"]+ self.llm_model = node_config["llm_model"]self.library = libraryself.source = website++ self.verbose = False if node_config is None else node_config.get("verbose", False)def execute(self, state: dict) -> dict:"""diff --cc scrapegraphai/nodes/parse_node.pyindex 94374248,d2e472a7..2cd7eb33--- a/scrapegraphai/nodes/parse_node.py+++ b/scrapegraphai/nodes/parse_node.py@@@ -26,11 -26,10 +26,11 @@@ class ParseNode(BaseNode)node_name (str): The unique identifier name for the node, defaulting to "Parse"."""- def __init__(self, input: str, output: List[str], node_config: dict, node_name: str = "Parse"):+ def __init__(self, input: str, output: List[str], node_config: Optional[dict]=None, node_name: str = "Parse"):super().__init__(node_name, "node", input, output, 1, node_config)- self.verbose = True if node_config is None else node_config.get("verbose", False)+ self.verbose = False if node_config is None else node_config.get("verbose", False)+ self.parse_html = True if node_config is None else node_config.get("parse_html", True)def execute(self, state: dict) -> dict:"""