redhairedshanks1 commited on
Commit
3cd5b75
·
1 Parent(s): 5cf6369

Update services/pipeline_executor.py

Browse files
Files changed (1) hide show
  1. services/pipeline_executor.py +6 -1
services/pipeline_executor.py CHANGED
@@ -174,7 +174,12 @@ Execute each component by calling the corresponding tool."""
174
  tool_results = {}
175
  has_called_tools = False
176
  step_count = 0
177
- max_iterations = 1 # Only try once, wait for response
 
 
 
 
 
178
 
179
  yield {
180
  "type": "status",
 
174
  tool_results = {}
175
  has_called_tools = False
176
  step_count = 0
177
+
178
+ # Set max_iterations based on number of components (with buffer for retries)
179
+ num_components = len(pipeline.get('components', []))
180
+ max_iterations = max(1, num_components + 2) # Components + 2 buffer for Final Answer
181
+
182
+ print(f"📋 Pipeline has {num_components} components, max_iterations={max_iterations}")
183
 
184
  yield {
185
  "type": "status",