Evaluate When • AI Agent SDK

evaluate_when: Evaluate the 'when' condition against the given context.

evaluate_when

Method

</div>

This is a method of the Task class in the task module.

Evaluate the ‘when’ condition against the given context.

Uses the shared evaluate_condition function from the conditions module for DRY compliance with AgentFlow condition evaluation.

Signature

python
def evaluate_when(context: Dict[str, Any]) -> bool

Parameters

ParamField Dict[str, Any]

Dictionary containing variables for evaluation. May include workflow variables, previous outputs, etc.

Returns

ResponseField bool

True if condition is met or no condition is set. False if condition is not met.

Uses

  • evaluate_condition

Used By

Source

View on GitHub

praisonaiagents/task/task.py at line 996


Related Documentation