OnContextCondition

OnContextCondition(
    target: ConversableAgent | dict[str, Any] | None = None,
    condition: str | ContextExpression | None = None,
    available: Callable[[ConversableAgent, list[dict[str, Any]]], bool] | str | ContextExpression | None = None
)

Defines a condition for transitioning to another agent or nested chats using context variables and the ContextExpression class.
This is for context variable-based condition evaluation (does not use the agent’s LLM).
These are evaluated before the OnCondition and AfterWork conditions.

Parameters:
NameDescription
targetType: ConversableAgent | dict[str, typing.Any] | None

Default: None
conditionType: str | ContextExpression | None

Default: None
availableType: Callable[[ConversableAgent, list[dict[str, Any]]], bool] | str | ContextExpression | None

Default: None

Class Attributes

available



condition



target