MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _dispatch_step

Method _dispatch_step

src/harness/execution/interpreter.py:258–362  ·  view source on GitHub ↗

Dispatch to the appropriate step handler based on step type. Args: step_data: Dictionary containing step configuration. context: Workflow context dictionary. step_number: Step identifier. args: EffectiveArgs with execution configuration.

(
        self,
        step_data: Dict[str, Any],
        context: Dict[str, Any],
        step_number: int,
        args,
        logger: Logger,
        checkpoint_manager: Optional[CheckpointManager] = None,
    )

Source from the content-addressed store, hash-verified

256 raise
257
258 def _dispatch_step(
259 self,
260 step_data: Dict[str, Any],
261 context: Dict[str, Any],
262 step_number: int,
263 args,
264 logger: Logger,
265 checkpoint_manager: Optional[CheckpointManager] = None,
266 ):
267 """Dispatch to the appropriate step handler based on step type.
268
269 Args:
270 step_data: Dictionary containing step configuration.
271 context: Workflow context dictionary.
272 step_number: Step identifier.
273 args: EffectiveArgs with execution configuration.
274 logger: Logger for output.
275 checkpoint_manager: Optional checkpoint manager.
276
277 Returns:
278 Tuple of (output, tokens) from the step handler.
279 """
280 if "step" in step_data:
281 return self.execute_basic_step(
282 step_data, context, step_number, args, logger
283 )
284 elif "task" in step_data:
285 return self.execute_task_step(step_data, context, step_number, args, logger)
286 elif "for_each" in step_data:
287 return self.execute_for_each_step(
288 step_data,
289 context,
290 step_number,
291 args,
292 logger,
293 checkpoint_manager=checkpoint_manager,
294 )
295 elif "if" in step_data:
296 return self.execute_conditional_step(
297 step_data,
298 context,
299 step_number,
300 args,
301 logger,
302 checkpoint_manager=checkpoint_manager,
303 )
304 elif "parallel" in step_data:
305 return self.execute_parallel_step(
306 step_data,
307 context,
308 step_number,
309 args,
310 logger,
311 checkpoint_manager=checkpoint_manager,
312 )
313 elif "while" in step_data:
314 return self.execute_while_step(
315 step_data,

Callers 1

execute_workflow_stepMethod · 0.95

Calls 13

execute_basic_stepMethod · 0.80
execute_task_stepMethod · 0.80
execute_for_each_stepMethod · 0.80
execute_parallel_stepMethod · 0.80
execute_while_stepMethod · 0.80
execute_switch_stepMethod · 0.80
execute_input_stepMethod · 0.80
execute_call_stepMethod · 0.80
execute_gather_stepMethod · 0.80

Tested by

no test coverage detected