Skip to content

Python scraper based on AI

removed unused function

Marco Vinciguerracf2734392cda
diff --git a/scrapegraphai/nodes/generate_answer_node.py b/scrapegraphai/nodes/generate_answer_node.py
index 9cd5dce5..d864124e 100644
--- a/scrapegraphai/nodes/generate_answer_node.py
+++ b/scrapegraphai/nodes/generate_answer_node.py
@@ -7,7 +7,6 @@ from langchain.prompts import PromptTemplate
from langchain_core.output_parsers import JsonOutputParser
from langchain_core.runnables import RunnableParallel
from tqdm import tqdm
-from ..utils.merge_results import merge_results
from ..utils.logging import get_logger
from ..models import Ollama, OpenAI
from .base_node import BaseNode
diff --git a/scrapegraphai/utils/__init__.py b/scrapegraphai/utils/__init__.py
index 15fd6886..707d2b18 100644
--- a/scrapegraphai/utils/__init__.py
+++ b/scrapegraphai/utils/__init__.py
@@ -11,4 +11,3 @@ from .sys_dynamic_import import dynamic_import, srcfile_import
from .cleanup_html import cleanup_html
from .logging import *
from .convert_to_md import convert_to_md
-from .merge_results import merge_results
diff --git a/scrapegraphai/utils/merge_results.py b/scrapegraphai/utils/merge_results.py
deleted file mode 100644
index ff5728fa..00000000
--- a/scrapegraphai/utils/merge_results.py
+++ /dev/null
@@ -1,30 +0,0 @@
-def merge_results(batch_answers):
- """
- Merges the results from single-chunk processing and batch processing, and adds separators between the chunks.
- Parameters:
- -----------
- answers : list of str
- A list of strings containing the results from single-chunk processing.
-
- batch_answers : list of dict
- A list of dictionaries, where each dictionary contains a key "text" with the batch processing result as a string.
-
- Returns:
- --------
- str
- A single string containing all merged results, with each result separated by a newline character.
-
- Example:
- --------
- >>> answers = ["Result from single-chunk 1", "Result from single-chunk 2"]
- >>> batch_answers = [{"text": "Result from batch 1"}, {"text": "Result from batch 2"}]
- >>> merge_results(answers, batch_answers)
- 'Result from single-chunk 1\nResult from single-chunk 2\nResult from batch 1\nResult from batch 2'
- """
- # Combine answers from single-chunk processing and batch processing
- merged_answers = [answer["text"] for answer in batch_answers]
-
- # Add separators between chunks
- merged_answers = "\n".join(merged_answers)
-
- return merged_answers
\ No newline at end of file