Skip to content

Python scraper based on AI

Miscellaneous "llm" -> "llm_model" refactors

Eric Page3ae2ea1dbd39
diff --git a/examples/openai/custom_graph_openai.py b/examples/openai/custom_graph_openai.py
index dab82c1f..5744669b 100644
--- a/examples/openai/custom_graph_openai.py
+++ b/examples/openai/custom_graph_openai.py
@@ -34,7 +34,7 @@ llm_model = OpenAI(graph_config["llm"])
robot_node = RobotsNode(
input="url",
output=["is_scrapable"],
- node_config={"llm": llm_model}
+ node_config={"llm_model": llm_model}
)
fetch_node = FetchNode(
@@ -50,12 +50,12 @@ parse_node = ParseNode(
rag_node = RAGNode(
input="user_prompt & (parsed_doc | doc)",
output=["relevant_chunks"],
- node_config={"llm": llm_model},
+ node_config={"llm_model": llm_model},
)
generate_answer_node = GenerateAnswerNode(
input="user_prompt & (relevant_chunks | parsed_doc | doc)",
output=["answer"],
- node_config={"llm": llm_model},
+ node_config={"llm_model": llm_model},
)
# ************************************************
diff --git a/scrapegraphai/graphs/json_scraper_graph.py b/scrapegraphai/graphs/json_scraper_graph.py
index 843fa2b7..aec41195 100644
--- a/scrapegraphai/graphs/json_scraper_graph.py
+++ b/scrapegraphai/graphs/json_scraper_graph.py
@@ -76,7 +76,7 @@ class JSONScraperGraph(AbstractGraph):
input="user_prompt & (relevant_chunks | parsed_doc | doc)",
output=["answer"],
node_config={
- "llm": self.llm_model
+ "llm_model": self.llm_model
}
)
diff --git a/scrapegraphai/nodes/fetch_node.py b/scrapegraphai/nodes/fetch_node.py
index f873654d..82d67949 100644
--- a/scrapegraphai/nodes/fetch_node.py
+++ b/scrapegraphai/nodes/fetch_node.py
@@ -29,7 +29,7 @@ class FetchNode(BaseNode):
node_name (str): The unique identifier name for the node, defaulting to "Fetch".
"""
- def __init__(self, input: str, output: List[str], node_config: Optional[dict], node_name: str = "Fetch"):
+ def __init__(self, input: str, output: List[str], node_config: Optional[dict]=None, node_name: str = "Fetch"):
super().__init__(node_name, "node", input, output, 1)
self.headless = True if node_config is None else node_config.get("headless", True)