Context
Depending on the state of a conversation you might want to provide a different answer to your end-users. Conversational AI Cloud calls this conversation state context, and the factors that might influence it are determined through context variables.
A context variable is a single indicator of the state (or environment) a conversation is taking place in. An example could be the context variable "logged_in" that could be true if your end-user is authenticated on your website, and false if they aren't authenticated. You might want to present a different answer to that individual if they are logged in versus when they aren't. Context variables are:
- A pre-defined variable with a pre-determined set of possible allowed values (learn more about how to work with them in our CMS)
- Evaluated for every individual interaction
And they can be set via:
- A query parameter when calling the Gateway API
- A context variable webhook
- Web Conversations JavaScript API (when using Web Conversations)
If the same context variable is set in different ways for an interaction then the following order is used to prevent conflicting definitions (first in the list is the lowest priority):
- Web Conversations JavaScript API
- Query parameter
- Context Variable webhook
The sole purpose of a context variable is to provide a different answer once an article (Q&A), event, or dialog (node) is matched by Conv. AI Cloud. Contextual answers can be defined through the Conv. AI Cloud CMS.
Updated over 1 year ago