From 778efd4c87c69754bfbbf7a80d652f4cfd31a361 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Sat, 10 Aug 2024 12:21:09 +0200 Subject: [PATCH] fix: conditional node --- scrapegraphai/nodes/conditional_node.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/scrapegraphai/nodes/conditional_node.py b/scrapegraphai/nodes/conditional_node.py index cee91156..6a1aad4e 100644 --- a/scrapegraphai/nodes/conditional_node.py +++ b/scrapegraphai/nodes/conditional_node.py @@ -1,4 +1,4 @@ -""" +""" Module for implementing the conditional node """ from typing import Optional, List @@ -28,21 +28,11 @@ class ConditionalNode(BaseNode): """ - def __init__(self, - input: str, - output: List[str], - node_config: Optional[dict] = None, - node_name: str = "GenerateAnswerCSV", - ): + def __init__(self): """ - Initializes the node with the key to check and the next node names based on the condition. - - Args: - key_name (str): The name of the key to check in the state. + Initializes an empty ConditionalNode. """ - - #super().__init__(node_name, "node", input, output, 2, node_config) - + pass def execute(self, state: dict) -> dict: """ @@ -55,8 +45,4 @@ class ConditionalNode(BaseNode): str: The name of the next node to execute based on the presence of the key. """ - if self.key_name in state and len(state[self.key_name]) > 0: - state["next_node"] = 0 - else: - state["next_node"] = 1 - return state + pass