co-context
warning
This documentation page is still being written.
Global Context
The global context includes the following variables:
Current Date and Time
Variable | Type | Description |
---|---|---|
$system_time | An ISO 8601 string for the current UTC time. | e.g. "14:37:23.000000" |
$system_date | An ISO 8601 string for the current UTC date. | e.g. "2022-07-14" |
$system_datetime | An ISO 8601 string for the current UTC date and time. | e.g. "2022-07-14T14:37:23.000000" |
note
Every time the content of the variables is read, it will reflect the date and time at that particular point in time.
Number of Bot Messages
The system will keep track of the number of messages sent to the user. This could be useful in some situations, for example when resuming a flow and deciding what to do based on how long the conversation history was.
Variable | Type | Description |
---|---|---|
$system_bot_messages_total | The total number of bot messages | e.g. 5 |
Current Event and Intent
The information about the latest event and intent is included in the following variables:
Variable | Type | Description |
---|---|---|
$event | Event object. | |
$intent | Intent object with the properties name and entities . | |
$entities | Direct access to $intent.entities . | |
$intent_name | Deprecated. | |
$intent_params | Deprecated. | |
$utterance | Utterance object with the last message from the bot. |
Flow State
The information about the current state of the flows is included in the following variables:
Variable | Type | Description |
---|---|---|
$active_flows | List of the names of all active flows. If there are multiple instances, the name of a flow will appear only once. | e.g. ["ask_name", "hello", ...] |
$active_labels | List of the label names in all active flows. The labels are prefixed with the name of the flow i.e. "FLOW_NAME.LABEL_NAME" | e.g. ["ask_name.wait_name", ...] |
$expected_next | List of the names of all intents expected next. |
Local Flow Variables
These context variables are set per flow:
Variable | Type | Description |
---|---|---|
$latest_intent_match | Event object representing the latest intent that was matched. |
Objects
The global context will keep track of all the recent objects that have been assigned in the context.
Variable | Type | Description |
---|---|---|
$Type | List of the recent objects of type Type |
Custom Global Variables
caution
Not implemented yet.
Custom global variables can be defined as follows:
define global context
# The name of the user
$name as string