fix: csv_node

This commit is contained in:
Marco Vinciguerra 2024-10-13 10:31:12 +02:00
parent 9fb0ff7a87
commit b208ef792c

View File

@ -60,7 +60,7 @@ class GenerateAnswerCSVNode(BaseNode):
self.additional_info = node_config.get("additional_info") self.additional_info = node_config.get("additional_info")
async def execute(self, state): def execute(self, state):
""" """
Generates an answer by constructing a prompt from the user's input and the scraped Generates an answer by constructing a prompt from the user's input and the scraped
content, querying the language model, and parsing its response. content, querying the language model, and parsing its response.
@ -157,7 +157,7 @@ class GenerateAnswerCSVNode(BaseNode):
) )
merge_chain = merge_prompt | self.llm_model | output_parser merge_chain = merge_prompt | self.llm_model | output_parser
answer = await merge_chain.ainvoke({"context": batch_results, "question": user_prompt}) answer = merge_chain.invoke({"context": batch_results, "question": user_prompt})
state.update({self.output[0]: answer}) state.update({self.output[0]: answer})
return state return state