66from langchain .output_parsers import CommaSeparatedListOutputParser
77from langchain .prompts import PromptTemplate
88from .base_node import BaseNode
9-
9+ from .. utils . logging import get_logger
1010
1111class GetProbableTagsNode (BaseNode ):
1212 """
@@ -25,11 +25,12 @@ class GetProbableTagsNode(BaseNode):
2525 node_name (str): The unique identifier name for the node, defaulting to "GetProbableTags".
2626 """
2727
28- def __init__ (self , input : str , output : List [str ], model_config : dict ,
28+ def __init__ (self , input : str , output : List [str ], node_config : dict ,
2929 node_name : str = "GetProbableTags" ):
30- super ().__init__ (node_name , "node" , input , output , 2 , model_config )
30+ super ().__init__ (node_name , "node" , input , output , 2 , node_config )
3131
32- self .llm_model = model_config ["llm_model" ]
32+ self .llm_model = node_config ["llm_model" ]
33+ self .verbose = False if node_config is None else node_config .get ("verbose" , False )
3334
3435 def execute (self , state : dict ) -> dict :
3536 """
@@ -49,7 +50,9 @@ def execute(self, state: dict) -> dict:
4950 necessary information for generating tag predictions is missing.
5051 """
5152
52- print (f"--- Executing { self .node_name } Node ---" )
53+ if self .verbose :
54+ logger = get_logger ("get probable tags node" )
55+ logger .info (f"--- Executing { self .node_name } Node ---" )
5356
5457 # Interpret input keys based on the provided input expression
5558 input_keys = self .get_input_keys (state )
0 commit comments