StringAvailableCondition

StringAvailableCondition(context_variable: str, **data: Any)

String-based available condition.
This condition checks if a named context variable exists and is truthy.
Initialize with a context variable name as a positional parameter.

Parameters:
NameDescription
context_variableType: str
**dataType: Any

Class Attributes

context_variable



model_config



Instance Methods

is_available

is_available(
    self,
    agent: ConversableAgent,
    messages: list[dict[str, Any]]
) -> bool

Check if the named context variable is truthy.

Parameters:
NameDescription
agentThe agent with context variables

Type: ConversableAgent
messagesThe conversation history (not used)

Type: list[dict[str, typing.Any]]
Returns:
TypeDescription
boolTrue if the variable exists and is truthy, False otherwise