How to use Chat Context in your Agent

icon picker
System context variables

@System Context Variables
are variables created in the
@Chat Context
by
@Platform
for service purposes and to ensure the operation of the
@Script
.
@System Context Variables
are not editable by the user, but can be viewed and used in the
@Script
.
This table lists all Platform
@System Context Variables
and their characteristics.
System context variables
1
Variable
Description
Usage
Variable always in context
Variable is never empty
Format
Example
Creation
Changed by user
1
agent_id
Unique identifier of the
@Agent
in the
@Platform
identification of the current
@Agent
in this
@Chat
Yes
Yes
number
1772
When creating a
@Chat
Disabled
2
chat_id
Unique
@Chat
ID in the
@Platform
@Chat
Identification in the
@Platform
@Chat
identification in
@Incoming Request Slot
Yes
Yes
40 characters: Latin letters and numbers
1fab819e20c1e939ed14d7024d17653fb07a77dd
When creating a
@Chat
Disabled
3
channel_chat_id
@Bot User
identifier in the
@End Channel
is a synthetic variable, the rules for its formation are set in the
@Connector
settings for this channel
Identification of
@Chat
and/or
@Bot User
in the
@End Channel
Creation of
@chat_id
Yes
Yes
<chat\interlocutor id>|<connector name>
192929922|telegram
When creating a
@Chat
Disabled
4
channel_id
Unique identifier of the
@End Channel
Unique identifier of the
@Project Channel
in which communication takes place in this
@Chat
Yes
Yes
number
28844
When creating a
@Chat
Disabled
5
client_message
Text of the last message that came from the
@Bot User
in
@Chat
@Agent
movement through the
@Script
in a
@Script
at the discretion of the user
in
@NLU
@Slot
, as an object for recognition
in the
@Regular Expression Slot
@Slot
, as an object to check for compliance with a regular expression
Yes
No
text, generated in the
@End Channel
Hello!
When receiving the first message from your
@Bot User
in
@Chat
Enabled
6
date
Time of receiving the last message from the
@Bot User
= time of receiving the last value of
@client_message
, but specifically from the
@Project Channel
(and not in the
@Memory
@Slot
)
in a
@Script
at the discretion of the user
for execution purposes of the
@Script
Yes
Yes
date time zone(UTC)
2020-12-17 13:29:19
When creating a
@Chat
Disabled
7
dialog_id
Conversation ID
for system purposes
Identification of new
@Dialog
Yes
Yes
line
1fab819e20c1e939ed14d7024d17653fb07a77dd
When creating a
@Chat
Disabled
8
modified_at
Time of last modification of the
@Chat Context
in a
@Script
at the discretion of the user
Yes
Yes
date time zone(UTC)
12/17/2020 10:46:25
When creating a
@Chat
Disabled
9
slot_id
@Platform
-unique identifier of the last "executed"
@Slot
in the
@Script
in a
@Script
at the discretion of the user
Yes
Yes
number
1
When creating a
@Chat
Disabled
10
strategy_modified_at
Creation time
@Trained Agent Model
(time of last
@Agent
@Training
)
in a
@Script
at the discretion of the user, also used to reset the
@Chat
state when
@Training
the
@Agent
Yes
Yes
date
12/17/2020 10:46:25
When creating a
@Chat
Disabled
11
confidence
Percentage of confidence of the
@NLU
model when recognizing
@Request
when going through the
@Script
after the
@NLU
@Slot
No
Yes, when in context
Floating point number
0.4812345
When passing the
@NLU
@Slot
Disabled
12
error
Error text received as a result of executing
@NLU
/
@Regular Expression Slot
/
@Memory
@Slot
when going through the
@Script
after
@NLU
/
@Regular Expression Slot
/
@Memory
@Slot
No
Yes, when in context
Line
no intent!
When passing
@NLU
/
@Regular Expression Slot
/
@Memory
@Slot
Disabled
13
incoming_request_id
@Platform
-unique identifier (token) of
@Incoming Request
used to initialize the passage of the
@Incoming Request Slot
No
Yes, when in context
Line
5944::80nyRRRjWAjQGfHkQJyJu6VWT8ToMpw79wi3m4e-x0g
When receiving a request to execute the
@Incoming Request Slot
Disabled
14
intent
@Platform
-unique identifier of the recognized Intent
when going through the
@Script
after the
@NLU
@Slot
No
Yes, when in context
Number
1
When passing the the
@NLU
@Slot
Disabled
15
request_success
Flag indicating the success of the last executed External Request in the
@Script
in a
@Script
at the discretion of the user
No
Yes, when in context
line
True or False
When receiving a response to an
@External Request
Enabled
16
response_status_code
Server response code to a completed external request
in a
@Script
at the discretion of the user
No
Yes, when in context
number
from 100 to 599
When receiving a response to an
@External Request
Enabled
17
parse_result
String - part of
@client_message
corresponding to the regular expression in the
@Regular Expression Slot
, obtained after successful verification of
@client_message
in this
@Slot
in a
@Script
at the discretion of the user
No
Yes, when in context
line
word
When passing the
@Regular Expression Slot
@Slot
Enabled
18
IR_url
Address of the active
@Incoming Request Webhook
in this
@Trained Agent Model
To send a request from external systems to the
@Agent
No
Yes, when in context
url
https://admin.chatme.ai/api/incoming_request/29614::XnLlRoKPAnwLKNoFHUWPmzYkE1fT9pi-10ZkjcmDRBc
When passing the
Disabled
19
savepoint_node_id
ID of the last
@Slot
reached in
@Conversation
with a set
@Savepoint
in the
@Jump
@Slot
to go to the corresponding
@Slot
using the “get slot id from context” option
No
Yes
number
1
When passing a
@Slot
with a
@Savepoint
Enabled
20
raw_response
The variable contains the response of the external system to the
@External Request
To debug the
@Agent
; to edit
@External Request
(find out what comes in response and what can be parsed)
No
No
line
Succesful request:
{"success":true,"temperature":"-5.3","feels_like":"-12.18"}
Inuccesful request:
{"success":false,"message":"empty city provided"}
When passing the
@External Request
@Slot
Enabled
21
response_headers
Variable contents: an array of headers and their values from the received response to the
@External Request
and system information.
in a
@Script
at the discretion of the user
No
No
line
Succesful request:
{'Server': 'nginx/1.14.0 (Ubuntu)', 'Date': 'Thu, 28 Apr 2022 12:09:42 GMT', 'Content-Type': 'application/json', 'Content-Length': '59', 'Connection': 'keep-alive'}
If the request is unsuccessful: if the request reaches the server, then the headers are formed, if not, then the variable is cleared
When passing the
@External Request
@Slot
Enabled
22
notification_count
Counter of mailings in a specific
@Chat
in a
@Script
at the discretion of the user
No
Yes, when in context
number
123
When passing the
@Notification
@Slot
Disabled
23
notification_task_id
Takes the value equal to the Mailing Task ID that the system sent in the response to the
@Mailing Request
from the external system
in a
@Script
at the discretion of the user
No
Yes, when in context
string (UUID)
123e4567-e89b-12d3-a456-426655440000
When passing the
@Notification
@Slot
Disabled
24
notification_init_time
Start date and time of the
@Notification
@Slot
execution in UTC
in a
@Script
at the discretion of the user
No
Yes, when in context
date Time
When passing the
@Notification
@Slot
Disabled
25
notification_message_id
When a mailing is sent, the
@End Channel
returns the message id
@Agent
movement through the
@Script
No
Yes, when in context
line
any line depending on the messenger
When passing the
@Notification
@Slot
Disabled
26
notification_id
mailing id, currently =
@Notification
@Slot
id
@Agent
movement through the
@Script
No
Yes, when in context
number
123
When passing the
@Notification
@Slot
Disabled
27
notification_raw_status
json object, a request that the
@End Channel
sends in response to a mailing, a description of the status
in a
@Script
at the discretion of the user
No
Yes, when in context
json object
{‘description’:’failed to build request’}
{‘description’:’no account on <phone number\key identifier of the interlocutor>’, 'channel_response': response body from the channel (object) }
When passing the
@Notification
@Slot
Enabled
28
notification_status
Technical status of the mailing Possible values: 'no_account', 'failed', 'sent', 'delivered', 'read'
@Agent
movement through the
@Script
No
Yes, when in context
line
'sent'
'delivered'
‘failed’
‘no_account’.
When passing the
@Notification
@Slot
Disabled
29
notification_raw_request
The request that the
@Platform
sends to the messenger to launch a mailing
in a
@Script
at the discretion of the user
No
Yes, when in context
json object
{
"to": "9601103070",
"type": "template",
"template": {
"namespace": "2a958ec8_9602_4cc0_aea4_73006715d273",
"name": "mailing_02",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "\u044d\u043d\u0434\u043e\u043a\u0440\u0438\u043d\u043e\u043b\u043e\u0433"
}
}
When passing the
@Notification
@Slot
Enabled
30
intent_name
The variable stores the name of the last completed
@intent
in a
@Script
at the discretion of the user
No
Yes, when in context
line
smalltalk_hello
When passing the
@intent
@Subslot
Enabled
31
nlu_result
The variable stores information about the top 5 recognized
@Intent
s in descending order of confidentiality
in a
@Script
at the discretion of the user
No
Yes, when in context
json object;
may contain a different number of key-value pairs:
5 pairs — if the
@NLU
@Slot
has 5 or more
@intent
@Subslot
s;
2-4 pairs — if the
@NLU
@Slot
has from 2 to 4
@intent
@Subslot
s (the number of pairs will correspond to the number of
@intent
@Subslot
s);
1 pair — if the
@Bot user’s Message
is an exact match of the
@Training Phrase
of one of the
@Intent
s
[{'intent_name': 'size', 'confidence': 0.9993743300437927}, {'intent_name': 'product_in_stock', 'confidence': 0.00019508253899402916}, {'intent_name': 'model_price', 'confidence': 0.00012844608863815665}, {'intent_name': 'address', 'confidence': 0.00010525238758418709}]
when passing the
@NLU
@Slot
Enabled
32
platform_chat_id
"Intermediate version" of the Chat ID, designed to match old chat IDs with new IDs
Service variable, not used yet
No
Yes, when in context
40 characters: Latin letters and numbers
1fab819e20c1e939ed14d7024d17653fb07a77dd
When creating a
@Chat
Disabled
33
chat_language
The variable stores the recognized language
in a
@Script
at the discretion of the user
No
Yes, when in context
line
Russian
when passing the
@Language
@Slot
Disabled
34
repeat_index
the variable is used to reflect the number of the current loop iteration, iteration numbering starts from 0
No
Disabled
No results from filter

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.