Receiving parameters change notification
You can configure VoiceAI Connect to notify the bot of changes to parameter values. For example, after changing the language, VoiceAI Connect can send an event to notify the bot, which "triggers" it to use the new language.
How to use this?
Bot configuration
This feature can be configured, using the following bot parameter:
See Changing call settings for details on how this parameter can be applied.
Parameter |
Type |
Description |
---|---|---|
Array of strings |
Defines a list of parameters for which VoiceAI Connect notifies the bot whenever their values change. By default, this parameter is not defined. |
Below shows an example for configuring VoiceAI Connect to notify the bot whenever changes to the language
parameter occurs:
{ "type": "config", "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } }
{ "type": "config", "channelData": { "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } } }
Send the session params with config event (see Sending event to VoiceAI Connect Enterprise)
{ "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } }
[Activity "type": "config", "channelData": ${json(`{ "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } } `)} }
Add a Custom Payload response with the following content:
{ "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } }
Add a Custom Payload response with the following content:
{ "sessionParams": { "language": "fr-FR", "notifyParamChange": [ "language" ] } }
Receiving the notification
VoiceAI Connect notifies the bot of parameter value changes, using the paramChanged
event message. The following field is sent with the event:
Field |
Type |
Description |
---|---|---|
|
Object |
A key-value object, whereby the key is the parameter whose value changed and the value is the new value of the parameter. If a parameter was removed from configuration (e.g., if a parameter was only set using Note:
|
The syntax per bot framework of the paramChanged
event message is shown below:
This message is sent as a paramChanged
event.
The additional field is sent as the value of the event.
Example:
{ "type": "event", "name": "paramChanged", "value": { "updatedParams": { "language": "fr-FR" } } }
This message is sent as a paramChanged
event.
The additional field is sent as the value of the event.
Example:
{ "type": "event", "name": "paramChanged", "value": { "updatedParams": { "language": "fr-FR" } } }
This message is sent as a paramChanged
event.
Example:
{ "type": "event", "name": "paramChanged", "value": { "updatedParams": { "language": "fr-FR" } } }
This message is sent as a paramChanged
event.
The additional field is sent as the value of the event.
Example:
{ "type": "event", "name": "paramChanged", "value": { "updatedParams": { "language": "fr-FR" } } }
This message is sent as a paramChanged
event.
The additional field is sent inside the parameters of the event.
Example:
{ "queryInput": { "event": { "languageCode": "fr-FR", "name": "paramChanged", "parameters": { "updatedParams": { "language": "fr-FR" } } } } }
For Dialogflow CX, the fields are also sent inside the event-paramChanged
session parameter, and can be accessed using a syntax such as this:
$session.params.event-paramChanged.updatedParams
This message is sent as a paramChanged
event.
The additional field is sent inside the parameters of the event.
Example:
{ "queryInput": { "event": { "languageCode": "fr-FR", "name": "paramChanged", "parameters": { "updatedParams": { "language": "fr-FR" } } } } }