Conditions
A condition is a true/false check on the user’s question.
A condition is a TRUE or FALSE check on the user’s question. A rule has many conditions. The rule’s story is selected as the Passing Rule, and if all the conditions are met, it's Story is returned as the bot's response.

Types of User Context

The user context is the data that is specifically assigned to a Rule. It determines the context of the message that the users might ask.
Message - what a user sends directly to the bot
Memory - what a bot remembers previously about the current chat session
User attribute - what a bot remembers about a user
Natural language Processing (NLP) - what the bot’s NLP engines evaluate a message with.
Memory
At times, a rule does not respond to user's direct message, rather it responds from the interaction history.
Example: If we go to the "hey!" story, we can add an "action" response to make the bot remember this. Let's set the action as follows:
Now when the bot replies to a user with "hey!", the bot actually set a property called "said-hey" to true on chat's session memory.
Add a NEW rule with a NEW condition:
and let's assign this to a new story called "You Just Said Hello"
Now, the chat will go as follows:
Attribute
With every User Context chosen, there will be an attribute (text, image, video, etc.).
The first step to implementing a condition is to select an attribute. The next step is to select a condition that complements the attribute.

Functions complementing the attribute
Every attribute comes with complementing functions.

has keyword
"has keyword" is one of the most commonly used functions for the text attribute. It is extremely helpful in FAQs.
does not have keyword
The opposite of the has keyword function. Checks if a property does not have a keyword from the list of declared keywords.
equals
Equals function prompts the chatbot to find the exact match of the word input. It checks an EXACT match. Used for direct checks.
does not equal
The opposite of the equals function. Checks if a property does not equal a value
matches regex
This is the most powerful check. Knowledge of regular expressions is required to use this function. Used for pattern-matching checks.
exists
Checks that a property exists. Does not require a value. Used for presence checks.
does not exist
Checks that a property does not exist. opposite of $exists. Does not require a value. Used for negation checks.
less than
Checks that a numeric property is less than the value. Used for number comparison checks.
greater than
Checks that a numeric property is greater than the value. Used for number comparison checks.
Last updated