feat: add new prompt info

This commit is contained in:
VinciGit00 2024-05-12 11:14:30 +02:00
parent 106fb12531
commit e2350eda62
3 changed files with 7 additions and 3 deletions

View File

@ -111,6 +111,7 @@ class GenerateAnswerCSVNode(BaseNode):
following content from a csv. following content from a csv.
You are now asked to answer a user question about the content you have scraped.\n 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 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 Output instructions: {format_instructions}\n
User question: {question}\n User question: {question}\n
csv content: {context}\n csv content: {context}\n

View File

@ -33,12 +33,13 @@ class GenerateAnswerNode(BaseNode):
node_name (str): The unique identifier name for the node, defaulting to "GenerateAnswer". 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"): node_name: str = "GenerateAnswer"):
super().__init__(node_name, "node", input, output, 2, node_config) super().__init__(node_name, "node", input, output, 2, node_config)
self.llm_model = node_config["llm_model"] 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: def execute(self, state: dict) -> dict:
""" """
@ -97,6 +98,7 @@ class GenerateAnswerNode(BaseNode):
following content from a website. following content from a website.
You are now asked to answer a user question about the content you have scraped.\n 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 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 Output instructions: {format_instructions}\n
User question: {question}\n User question: {question}\n
Website content: {context}\n Website content: {context}\n

View File

@ -111,6 +111,7 @@ class GenerateAnswerPDFNode(BaseNode):
following content from a PDF. following content from a PDF.
You are now asked to answer a user question about the content you have scraped.\n 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 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 Output instructions: {format_instructions}\n
User question: {question}\n User question: {question}\n
PDF content: {context}\n PDF content: {context}\n