conditions#

The collection of preexisting Conditions.

A condition can be embedded in a Transition so that when it is satisfied, the transition will be triggered (given that the other transition conditions are satisfied as well)

class besser.agent.library.transition.conditions.IntentMatcher(intent)[source]#

Bases: Condition

A condition that checks if an incoming intent matches a predefined intent.

Parameters:

intent (Intent) – the target intent

_intent#

the target intent

Type:

Intent

class besser.agent.library.transition.conditions.VariableOperationMatcher(var_name, operation, target)[source]#

Bases: Condition

A condition that checks if (variable operator target_value) is satisfied. For instance, “age > 18”.

Parameters:
  • var_name (str) – the name of the variable to evaluate. The variable must exist in the user session

  • operation (Callable[[Any, Any], bool]) – the operation to apply to the variable and the target value. It gets as arguments the variable and the target value, and returns a boolean value

  • target (Any) – the target value to compare with the variable

_var_name#

the name of the variable to evaluate. The variable must exist in the user session

Type:

str

_operation#

the operation to apply to the variable and the target value. It gets as arguments the variable and the target value, and returns a boolean value

Type:

Callable[[Any, Any], bool]

_target#

the target value to compare with the variable

Type:

Any