cryogenic22 commited on
Commit
b0ea79d
·
verified ·
1 Parent(s): a502523

Update workflows/sales_analysis.py

Browse files
Files changed (1) hide show
  1. 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
- workflow.add_edge(
 
96
  "planning",
97
  "handle_error",
98
- condition=lambda x: x["status"] == "error"
99
  )
100
- workflow.add_edge(
101
  "data_collection",
102
  "handle_error",
103
- condition=lambda x: x["status"] == "error"
104
  )
105
- workflow.add_edge(
106
  "analysis",
107
  "handle_error",
108
- condition=lambda x: x["status"] == "error"
109
  )
110
- workflow.add_edge(
111
  "validation",
112
  "handle_error",
113
- condition=lambda x: x["status"] == "error"
114
  )
115
- workflow.add_edge(
116
  "insights",
117
  "handle_error",
118
- condition=lambda x: x["status"] == "error"
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