Spaces:
Runtime error
Runtime error
Update graph_builder.py
Browse files- 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 |
-
#
|
| 715 |
-
|
| 716 |
-
|
| 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()
|