Skip to content

Commit 0e85e8f

Browse files
add info for merge_explore_graph
Co-Authored-By: Matteo Vedovati <68272450+vedovati-matteo@users.noreply.github.com>
1 parent 3d8c3a3 commit 0e85e8f

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

scrapegraphai/nodes/generate_answer_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545
node_name: str = "GenerateAnswer",
4646
):
4747
super().__init__(node_name, "node", input, output, 2, node_config)
48-
48+
4949
self.llm_model = node_config["llm_model"]
5050

5151
if isinstance(node_config["llm_model"], Ollama):

scrapegraphai/nodes/merge_explore_graphs_node.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88
# Imports from Langchain
99
from langchain.prompts import PromptTemplate
1010
from langchain_core.output_parsers import JsonOutputParser
11-
from langchain_core.runnables import RunnableParallel
1211
from tqdm import tqdm
13-
14-
15-
from ..utils.logging import get_logger
1612
from ..models import Ollama
17-
# Imports from the library
1813
from .base_node import BaseNode
19-
from ..helpers import template_chunks, template_no_chunks, template_merge
2014

2115

2216
class MergeExploreGraphsNode(BaseNode):
@@ -42,10 +36,10 @@ def __init__(
4236
input: str,
4337
output: List[str],
4438
node_config: Optional[dict] = None,
45-
node_name: str = "GenerateAnswer",
39+
node_name: str = "MergeExploreGraph",
4640
):
4741
super().__init__(node_name, "node", input, output, 2, node_config)
48-
42+
4943
self.llm_model = node_config["llm_model"]
5044

5145
if isinstance(node_config["llm_model"], Ollama):
@@ -74,6 +68,20 @@ def execute(self, state: dict) -> dict:
7468

7569
self.logger.info(f"--- Executing {self.node_name} Node ---")
7670

77-
78-
state.update({self.output[0]: "answaer"})
71+
template_answer = ""
72+
73+
answers = str(state.get("answer"))
74+
relevant_links = str(state.get("relevant_links"))
75+
answer = {}
76+
77+
merge_prompt = PromptTemplate(
78+
template=template_answer,
79+
#input_variables=["context", "question"],
80+
#partial_variables={"format_instructions": format_instructions},
81+
)
82+
83+
#answer = merge_prompt.invoke({"question": user_prompt})
84+
85+
state.update({"relevant_links": "TODO"})
86+
state.update({"answer": "TODO"})
7987
return state

0 commit comments

Comments
 (0)