Skip to content

feat: add new prompt info #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scrapegraphai/nodes/generate_answer_csv_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def execute(self, state):
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
Expand Down
8 changes: 5 additions & 3 deletions scrapegraphai/nodes/generate_answer_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -97,6 +98,7 @@ def execute(self, state: dict) -> dict:
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
Expand Down
1 change: 1 addition & 0 deletions scrapegraphai/nodes/generate_answer_pdf_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def execute(self, state):
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
Expand Down
Loading