Skip to content

Python scraper based on AI

removed the duplicates

VinciGit006663c9c5bc46
diff --git a/commit_and_push.sh b/commit_and_push.sh
index 20be12fc..ff6dcc4c 100755
--- a/commit_and_push.sh
+++ b/commit_and_push.sh
@@ -21,7 +21,7 @@ commit_message="$1"
# Run Pylint on the specified Python files
pylint scrapegraphai/**/*.py scrapegraphai/*.py examples/**/*.py tests/**/*.py
-#Maket the pull
+#Make the pull
git pull
# Add the modified files to the Git repository
diff --git a/scrapegraphai/nodes/generate_answer_node.py b/scrapegraphai/nodes/generate_answer_node.py
index 0c379cd4..da9e4052 100644
--- a/scrapegraphai/nodes/generate_answer_node.py
+++ b/scrapegraphai/nodes/generate_answer_node.py
@@ -131,13 +131,16 @@ class GenerateAnswerNode(BaseNode):
)
merge_chain = merge_prompt | self.llm | output_parser
- answer = []
+ answer_lines = []
for chunk in chunks:
+ print(i)
answer_temp = merge_chain.invoke(
{"context": chunk, "question": user_input})
+ print(answer_temp)
+ answer_lines.append(answer_temp)
- answer.append(answer_temp)
+ unique_answer_lines = list(set(answer_lines))
+ answer = '\n'.join(unique_answer_lines)
- # Update the state with the generated answer
state.update({"answer": answer})
return state