OnContextCondition

OnContextCondition(**data: Any)

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 after work conditions.

Parameters:
NameDescription
**dataType: Any

Class Attributes

available



condition



model_config



target



Instance Methods

has_target_type

has_target_type(self, target_type: type) -> bool

Check if the target type matches the specified type.

Parameters:
NameDescription
target_typeThe target type to check against.

Should be a subclass of TransitionTarget.

Type: type
Returns:
TypeDescription
boolbool: True if the target type matches, False otherwise

target_requires_wrapping

target_requires_wrapping(self) -> bool

Check if the target requires wrapping in an agent.
Returns:
bool: True if the target requires wrapping, False otherwise

Returns:
TypeDescription
boolbool: True if the target requires wrapping, False otherwise