cryogenic22 commited on
Commit
131cc45
·
verified ·
1 Parent(s): 44807d8

Update graph_builder.py

Browse files
Files changed (1) hide show
  1. graph_builder.py +3 -11
graph_builder.py CHANGED
@@ -711,17 +711,9 @@ def build_document_extraction_graph():
711
  workflow.add_edge("extract_study_design", "store_in_knowledge_base")
712
  workflow.add_edge("store_in_knowledge_base", END)
713
 
714
- # Handle errors - any node can output an error
715
- for node in workflow.nodes:
716
- # Check if status is error, if yes, go to END
717
- workflow.add_conditional_edges(
718
- node,
719
- lambda state: "status" in state and state["status"] == "error",
720
- {
721
- True: END,
722
- False: None # Let the normal flow continue
723
- }
724
- )
725
 
726
  workflow.set_entry_point("parse_document")
727
  return workflow.compile()
 
711
  workflow.add_edge("extract_study_design", "store_in_knowledge_base")
712
  workflow.add_edge("store_in_knowledge_base", END)
713
 
714
+ # Instead of using conditional edges for all nodes,
715
+ # let each function handle its own error status
716
+ # This simplifies the graph structure and avoids the conditional edge issue
 
 
 
 
 
 
 
 
717
 
718
  workflow.set_entry_point("parse_document")
719
  return workflow.compile()