Skip to content

Python scraper based on AI

feat: add new prompt info

VinciGit00e2350eda6249
diff --git a/scrapegraphai/nodes/generate_answer_csv_node.py b/scrapegraphai/nodes/generate_answer_csv_node.py
index 7f2a46a5..53f7121b 100644
--- a/scrapegraphai/nodes/generate_answer_csv_node.py
+++ b/scrapegraphai/nodes/generate_answer_csv_node.py
@@ -111,6 +111,7 @@ class GenerateAnswerCSVNode(BaseNode):
following content from a csv.
You are now asked to answer a user question about the content you have scraped.\n
You have scraped many chunks since the csv is big and now you are asked to merge them into a single answer without repetitions (if there are any).\n
+ Make sure that if a maximum number of items is specified in the instructions that you get that maximum number and do not exceed it. \n
Output instructions: {format_instructions}\n
User question: {question}\n
csv content: {context}\n
diff --git a/scrapegraphai/nodes/generate_answer_node.py b/scrapegraphai/nodes/generate_answer_node.py
index 90ab704d..f554f8d9 100644
--- a/scrapegraphai/nodes/generate_answer_node.py
+++ b/scrapegraphai/nodes/generate_answer_node.py
@@ -33,12 +33,13 @@ class GenerateAnswerNode(BaseNode):
node_name (str): The unique identifier name for the node, defaulting to "GenerateAnswer".
"""
- def __init__(self, input: str, output: List[str], node_config: Optional[dict]=None,
+ def __init__(self, input: str, output: List[str], node_config: Optional[dict] = None,
node_name: str = "GenerateAnswer"):
super().__init__(node_name, "node", input, output, 2, node_config)
-
+
self.llm_model = node_config["llm_model"]
- self.verbose = False 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)
def execute(self, state: dict) -> dict:
"""
@@ -97,6 +98,7 @@ class GenerateAnswerNode(BaseNode):
following content from a website.
You are now asked to answer a user question about the content you have scraped.\n
You have scraped many chunks since the website is big and now you are asked to merge them into a single answer without repetitions (if there are any).\n
+ Make sure that if a maximum number of items is specified in the instructions that you get that maximum number and do not exceed it. \n
Output instructions: {format_instructions}\n
User question: {question}\n
Website content: {context}\n
diff --git a/scrapegraphai/nodes/generate_answer_pdf_node.py b/scrapegraphai/nodes/generate_answer_pdf_node.py
index 2f34ee69..31839d22 100644
--- a/scrapegraphai/nodes/generate_answer_pdf_node.py
+++ b/scrapegraphai/nodes/generate_answer_pdf_node.py
@@ -111,6 +111,7 @@ class GenerateAnswerPDFNode(BaseNode):
following content from a PDF.
You are now asked to answer a user question about the content you have scraped.\n
You have scraped many chunks since the PDF is big and now you are asked to merge them into a single answer without repetitions (if there are any).\n
+ Make sure that if a maximum number of items is specified in the instructions that you get that maximum number and do not exceed it. \n
Output instructions: {format_instructions}\n
User question: {question}\n
PDF content: {context}\n