@@ -29,12 +29,13 @@ class MergeAnswersNode(BaseNode):
29
29
node_name (str): The unique identifier name for the node, defaulting to "GenerateAnswer".
30
30
"""
31
31
32
- def __init__ (self , input : str , output : List [str ], node_config : Optional [dict ]= None ,
32
+ def __init__ (self , input : str , output : List [str ], node_config : Optional [dict ] = None ,
33
33
node_name : str = "MergeAnswers" ):
34
34
super ().__init__ (node_name , "node" , input , output , 2 , node_config )
35
-
35
+
36
36
self .llm_model = node_config ["llm_model" ]
37
- self .verbose = True if node_config is None else node_config .get ("verbose" , False )
37
+ self .verbose = True if node_config is None else node_config .get (
38
+ "verbose" , False )
38
39
39
40
def execute (self , state : dict ) -> dict :
40
41
"""
@@ -63,12 +64,12 @@ def execute(self, state: dict) -> dict:
63
64
64
65
user_prompt = input_data [0 ]
65
66
answers = input_data [1 ]
66
-
67
+
67
68
# merge the answers in one string
68
69
answers_str = ""
69
70
for i , answer in enumerate (answers ):
70
71
answers_str += f"CONTENT WEBSITE { i + 1 } : { answer } \n "
71
-
72
+
72
73
output_parser = JsonOutputParser ()
73
74
format_instructions = output_parser .get_format_instructions ()
74
75
@@ -79,7 +80,7 @@ def execute(self, state: dict) -> dict:
79
80
The scraped contents are in a JSON format and you need to merge them based on the context and providing a correct JSON structure.\n
80
81
OUTPUT INSTRUCTIONS: {format_instructions}\n
81
82
USER PROMPT: {user_prompt}\n
82
- {website_content}
83
+ WEBSITE CONTENT: {website_content}
83
84
"""
84
85
85
86
prompt_template = PromptTemplate (
0 commit comments