Spaces:
Runtime error
Runtime error
Update workflows/sales_analysis.py
Browse files- workflows/sales_analysis.py +11 -10
workflows/sales_analysis.py
CHANGED
|
@@ -92,30 +92,31 @@ class SalesAnalysisWorkflow:
|
|
| 92 |
workflow.add_node("handle_error", self.handle_error_node)
|
| 93 |
|
| 94 |
# Add conditional edges for error handling
|
| 95 |
-
|
|
|
|
| 96 |
"planning",
|
| 97 |
"handle_error",
|
| 98 |
-
|
| 99 |
)
|
| 100 |
-
workflow.
|
| 101 |
"data_collection",
|
| 102 |
"handle_error",
|
| 103 |
-
|
| 104 |
)
|
| 105 |
-
workflow.
|
| 106 |
"analysis",
|
| 107 |
"handle_error",
|
| 108 |
-
|
| 109 |
)
|
| 110 |
-
workflow.
|
| 111 |
"validation",
|
| 112 |
"handle_error",
|
| 113 |
-
|
| 114 |
)
|
| 115 |
-
workflow.
|
| 116 |
"insights",
|
| 117 |
"handle_error",
|
| 118 |
-
|
| 119 |
)
|
| 120 |
workflow.add_edge("handle_error", END)
|
| 121 |
|
|
|
|
| 92 |
workflow.add_node("handle_error", self.handle_error_node)
|
| 93 |
|
| 94 |
# Add conditional edges for error handling
|
| 95 |
+
# Using add_edge_condition instead of add_edge with condition parameter
|
| 96 |
+
workflow.add_edge_condition(
|
| 97 |
"planning",
|
| 98 |
"handle_error",
|
| 99 |
+
lambda x: x["status"] == "error"
|
| 100 |
)
|
| 101 |
+
workflow.add_edge_condition(
|
| 102 |
"data_collection",
|
| 103 |
"handle_error",
|
| 104 |
+
lambda x: x["status"] == "error"
|
| 105 |
)
|
| 106 |
+
workflow.add_edge_condition(
|
| 107 |
"analysis",
|
| 108 |
"handle_error",
|
| 109 |
+
lambda x: x["status"] == "error"
|
| 110 |
)
|
| 111 |
+
workflow.add_edge_condition(
|
| 112 |
"validation",
|
| 113 |
"handle_error",
|
| 114 |
+
lambda x: x["status"] == "error"
|
| 115 |
)
|
| 116 |
+
workflow.add_edge_condition(
|
| 117 |
"insights",
|
| 118 |
"handle_error",
|
| 119 |
+
lambda x: x["status"] == "error"
|
| 120 |
)
|
| 121 |
workflow.add_edge("handle_error", END)
|
| 122 |
|