condition_functions#

The collection of preexisting condition functions.

Functions embedded in Condition that, when called and return a True value, trigger the transitions.

besser.agent.library.transition.condition_functions.file_type(session, params)[source]#

This function only returns True if a user sent a file of an allowed type.

Parameters:
  • session (Session) – the current user session

  • params (dict) – the function parameters

Returns:

True if the user has sent a file and the received file type corresponds to the allowed types as defined in “allowed_types”

Return type:

bool

besser.agent.library.transition.condition_functions.intent_matched(session, params)[source]#

This function checks if 2 intents are the same, used for intent matching checking.

Parameters:
  • session (Session) – the current user session

  • params (dict) – the function parameters

Returns:

True if the 2 intents are the same, false otherwise

Return type:

bool

besser.agent.library.transition.condition_functions.variable_matches_operation(session, params)[source]#

This function checks if for a specific comparison operation, using a stored session value and a given target value, returns true.

Parameters:
  • session (Session) – the current user session

  • params (dict) – the function parameters

Returns:

True if the comparison operation of the given values returns true

Return type:

bool