Skip to main content

get_next_task

Method
This is a method of the Task class in the task module.
Get the next task name based on the ‘when’ condition evaluation. This provides a simple routing mechanism for Task objects, similar to AgentFlow’s when() function.

Signature

def get_next_task(context: Dict[str, Any]) -> Optional[str]

Parameters

context
Dict
required
Dictionary containing variables for evaluation.

Returns

Returns
Optional[str]
then_task if condition is True, else_task if False. None if no routing is configured.

Uses

  • evaluate_when

Source

View on GitHub

praisonaiagents/task/task.py at line 842