Open
Description
When using Human in the loop with data cleaning I get a ValueError: Found edge ending at unknown node explain_data_cleaner_code
here is the full traceback:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[8], line 1
----> 1 data_cleaning_agent = DataCleaningAgent(
2 model = llm,
3 log=LOG,
4 log_path=LOG_PATH,
5 n_samples=100,
6 bypass_recommended_steps=True,
7 human_in_the_loop=True,
8 )
10 # data_cleaning_agent
File ~\miniconda3\envs\llmtest\lib\site-packages\ai_data_science_team\agents\data_cleaning_agent.py:181, in DataCleaningAgent.__init__(self, model, n_samples, log, log_path, file_name, function_name, overwrite, human_in_the_loop, bypass_recommended_steps, bypass_explain_code, checkpointer)
154 def __init__(
155 self,
156 model,
(...)
166 checkpointer: Checkpointer = None
167 ):
168 self._params = {
169 "model": model,
170 "n_samples": n_samples,
(...)
179 "checkpointer": checkpointer
180 }
--> 181 self._compiled_graph = self._make_compiled_graph()
182 self.response = None
File ~\miniconda3\envs\llmtest\lib\site-packages\ai_data_science_team\agents\data_cleaning_agent.py:189, in DataCleaningAgent._make_compiled_graph(self)
185 """
186 Create the compiled graph for the data cleaning agent. Running this method will reset the response to None.
187 """
188 self.response=None
--> 189 return make_data_cleaning_agent(**self._params)
File ~\miniconda3\envs\llmtest\lib\site-packages\ai_data_science_team\agents\data_cleaning_agent.py:685, in make_data_cleaning_agent(model, n_samples, log, log_path, file_name, function_name, overwrite, human_in_the_loop, bypass_recommended_steps, bypass_explain_code, checkpointer)
662 return node_func_report_agent_outputs(
663 state=state,
664 keys_to_include=[
(...)
673 custom_title="Data Cleaning Agent Outputs"
674 )
676 node_functions = {
677 "recommend_cleaning_steps": recommend_cleaning_steps,
678 "human_review": human_review,
(...)
682 "report_agent_outputs": report_agent_outputs,
683 }
--> 685 app = create_coding_agent_graph(
686 GraphState=GraphState,
687 node_functions=node_functions,
688 recommended_steps_node_name="recommend_cleaning_steps",
689 create_code_node_name="create_data_cleaner_code",
690 execute_code_node_name="execute_data_cleaner_code",
691 fix_code_node_name="fix_data_cleaner_code",
692 explain_code_node_name="report_agent_outputs",
693 error_key="data_cleaner_error",
694 human_in_the_loop=human_in_the_loop,
695 human_review_node_name="human_review",
696 checkpointer=checkpointer,
697 bypass_recommended_steps=bypass_recommended_steps,
698 bypass_explain_code=bypass_explain_code,
699 agent_name=AGENT_NAME,
700 )
702 return app
File ~\miniconda3\envs\llmtest\lib\site-packages\ai_data_science_team\templates\agent_templates.py:405, in create_coding_agent_graph(GraphState, node_functions, recommended_steps_node_name, create_code_node_name, execute_code_node_name, fix_code_node_name, explain_code_node_name, error_key, max_retries_key, retry_count_key, human_in_the_loop, human_review_node_name, checkpointer, bypass_recommended_steps, bypass_explain_code, agent_name)
402 workflow.add_edge(explain_code_node_name, END)
404 # Finally, compile
--> 405 app = workflow.compile(
406 checkpointer=checkpointer,
407 name=agent_name,
408 )
410 return app
File ~\miniconda3\envs\llmtest\lib\site-packages\langgraph\graph\state.py:599, in StateGraph.compile(self, checkpointer, store, interrupt_before, interrupt_after, debug, name)
596 interrupt_after = interrupt_after or []
598 # validate the graph
--> 599 self.validate(
600 interrupt=(
601 (interrupt_before if interrupt_before != "*" else []) + interrupt_after
602 if interrupt_after != "*"
603 else []
604 )
605 )
607 # prepare output channels
608 output_channels = (
609 "__root__"
610 if len(self.schemas[self.output]) == 1
(...)
616 ]
617 )
File ~\miniconda3\envs\llmtest\lib\site-packages\langgraph\graph\graph.py:292, in Graph.validate(self, interrupt)
290 for target in all_targets:
291 if target not in self.nodes and target != END:
--> 292 raise ValueError(f"Found edge ending at unknown node `{target}`")
293 # validate interrupts
294 if interrupt:
ValueError: Found edge ending at unknown node `explain_data_cleaner_code`