Skip to content

Python scraper based on AI

fix: generate answer node omni

Marco Vinciguerrab52e4a390bb2
diff --git a/examples/local_models/smart_scraper_ollama.py b/examples/local_models/smart_scraper_ollama.py
index 5a33dabc..b161cd0f 100644
--- a/examples/local_models/smart_scraper_ollama.py
+++ b/examples/local_models/smart_scraper_ollama.py
@@ -22,10 +22,9 @@ graph_config = {
# ************************************************
# Create the SmartScraperGraph instance and run it
# ************************************************
-
smart_scraper_graph = SmartScraperGraph(
- prompt="List me all the titles of the website",
- source="https://sport.sky.it/nba?gr=www",
+ prompt="Find some information about what does the company do, the name and a contact email.",
+ source="https://scrapegraphai.com/",
config=graph_config
)
diff --git a/scrapegraphai/nodes/generate_answer_omni_node.py b/scrapegraphai/nodes/generate_answer_omni_node.py
index 93e96f4e..55b8b5f3 100644
--- a/scrapegraphai/nodes/generate_answer_omni_node.py
+++ b/scrapegraphai/nodes/generate_answer_omni_node.py
@@ -105,7 +105,7 @@ class GenerateAnswerOmniNode(BaseNode):
template=template_no_chunk_omni_prompt,
input_variables=["question"],
partial_variables={
- "context": chunk,
+ "context": doc,
"format_instructions": format_instructions,
"img_desc": imag_desc,
},
diff --git a/scrapegraphai/nodes/generate_answer_pdf_node.py b/scrapegraphai/nodes/generate_answer_pdf_node.py
index 04a27d9d..7b321415 100644
--- a/scrapegraphai/nodes/generate_answer_pdf_node.py
+++ b/scrapegraphai/nodes/generate_answer_pdf_node.py
@@ -56,7 +56,7 @@ class GenerateAnswerPDFNode(BaseNode):
self.llm_model = node_config["llm_model"]
if isinstance(node_config["llm_model"], ChatOllama):
self.llm_model.format="json"
-
+
self.verbose = (
False if node_config is None else node_config.get("verbose", False)
)
@@ -114,7 +114,7 @@ class GenerateAnswerPDFNode(BaseNode):
template=template_no_chunks_pdf_prompt,
input_variables=["question"],
partial_variables={
- "context":doc,
+ "context": doc,
"format_instructions": format_instructions,
},
)