Google Dialogflow ES
Dialogflow is a third-party platform that makes it easy to design and integrate a virtual agent bot (voicebot). Dialogflow can analyze various types of input from users, such as text or audio input. In response, it can also respond to users in a number of ways, either via text or synthetic speech.
With VCC Live, the integration of Google Dialogflow can take our IVR systems to the next level. After integration, you can navigate your customers from the IVR in VCC Live directly to a Dialogflow virtual agent and let the voicebot reply to customer interactions based on your predefined questions and answers. In VCC Live, it appears as an inbound process when creating the structure of an IVR, and it can control several things, as well as navigate the user in the call on the other end of the line.
Table of Contents
- How to integrate your Dialogflow with VCC Live?
- Dialogflow ES Media Service process parameters
- Handling Parameters
- Default Intents
- Using Parameters in a Dialogflow Response
- Using Actions and Parameters in VCC IVR
- Use Dialogflow ES Parameters on the Agent Script
How to integrate your Dialogflow with VCC Live?
First, you need to create your Dialogflow structure on the Google Dialogflow interface.
To learn more about creating Dialogflow structures on a Google workspace, please visit the official Google Dialogflow site.
Then, to access Dialogflow in VCC Live, do the following:
Navigate to project > Channels > Voice > Inbound
In the Processes tab, you can find the Actions drop-down menu. Here you can select Media Services and insert it into your IVR structure. In Media service type select Dialog Flow ES
Dialogflow ES Media Service process parameters
A Dialogflow ES Media Services process has several parameters. These are:
Waiting time (sec): The Dialogflow process remains active for the time duration set here. If the Dialogflow process does not perceive any input from the user’s side, then the IVR moves on to the next step set in the IVR flow. In such a case, the error variable receives the Timeout message.
In the Initialization parameters, you can provide the following:
endpoint: The endpoint that VCC Live shall access based on your region in Google, e.g.: “europe-west3-dialogflow.googleapis.com:443”
projects: The technical name of your project in Google, e.g.: “vcc-test”
locations: The location where your Dialogflow agents are hosted, e.g.: “europe-west3”
languageCode: The language in which the voicebot is initialized, e.g.: “en”
model: The transcription model that shall be used for the bot, e.g.: “latest_short”. Read more about models here.
event: Optional, the name of the event you would like to initialize the process with
environments: The name of the environment, where the agent shall be triggered, e.g.: “draft”
See example below:
{
"endpoint": "europe-west3-dialogflow.googleapis.com:443",
"projects": "test-project",
"locations": "europe-west3",
"languageCode": "en",
"model": "telephony_short",
"event": "",
"environments": "draft"
}
Handling Parameters
You can pass on parameters to Dialogflow ES in the section Input parameters / Parameters. They need to be in the following format:
{
"customerName": "${source}",
"phones": ["${source}", "${destination}"],
"number": 312312,
"boolean": true
}
Note: When you send parameters from VCC Live to Dialogflow ES, don’t forget to use a Query data process before gathering that data in the IVR.
You can also use parameters generated by Dialogflow es the following way:
Action variable name: The name of the Action parameter provided by the Dialogflow. It can be used for creating your IVR, e.g. using it with an IF function. Please note that the first character here needs to be a dollar sign ($). You can find the name of the relevant action in Dialogflow under the section Action and parameters. Read more about it here..
Context parameters name: The name of Dialogflow’s context parameters. It can be used for creating your IVR. Please note that the first character here needs to be a dollar sign ($). You can find the list of parameters in Dialogflow under the section Action and parameters Read more about it here.
Response variable name: The entire response object is stored in this variable. It is saved in JSON format. It can be sent via IVR webhook for further processing. Please note that the first character here needs to be a dollar sign ($).
Error variable name: It includes various kinds of messages if the Dialogflow process fails. Error messages include events such as: project is not found, language code is not recognized, credential file is not found, etc. Please note that the first character here needs to be a dollar sign ($).
Note: To end a conversation and transfer variables to VCC, mark your final intent as Set this intent as end of conversation in Dialogflow.
Credential file: To link your Dialogflow process in VCC Live with your Google Dialogflow structure, you need to authenticate the request to integrate this structure in VCC Live. This can be done by downloading the Credential file from the Google Cloud Platform interface and then uploading it here.
Note: You can generate your Credential file on the Google Cloud Platform interface by following this guide.
Default Intents
In a default setup, Dialogflow ES expects your customer to introduce itself.
- If the customer’s introduction matches the Default Welcome Intent, then the appropriate response is played.
- If the customer’s introduction doesn’t match any intent, then the Default fallback event response is played with one of the responses.
Read more about default intents here.
To avoid missing initial customer input, you can add a Playback or Read-back process in the IVR before the voicebot.
Using Parameters in a Dialogflow Response
If you would like to read back parameters/variables to the Customer in a Dialogflow ES Media Service process, then you can do that by following these steps:
- In the IVR, query the necessary data you would like to pass to Dialogflow with a Query data process
- In the Dialogflow ES Media Service process, populate the Event parameters like this: {“field1″:”${field1}”,”field2″:”${field2}”,”field3″:”${field3}”}, when e.g. field1, field2 and field3 are fields in your project
- In Dialogflow you can create a value set in the Entities menu if you would like to, but it is not necessary
- If you would like to use the parameter in an intent, then select the intent and navigate to Action and parameters
- Create a name for the parameter, like field1
- Select entity, like @sys.any, or @sys.number for numbers
- Populate value with the variable name like $field1
- In the response, use the parameter like Are you $field ?
If you would like to use the parameter in a follow-up intent, then you could use it in the following format: #Intent-followup.field1
Using Actions and Parameters in VCC IVR
If you would like to use an action or a parameter from Dialogflow in VCC IVR (e.g. to navigate the user to the agent queue if certain conditions are met), then do the following
- In Dialogflow under your selected intent, check the Action and parameters section. Copy the action or create a parameter. To create a simple parameter, enter a parameter name (e.g. ‘humanagent’), an entity (e.g. @sys.any) and a value (e.g. ‘yes’). You can read more about parameters here.
- In the Dialogflow ES Media Service process, capture action variable and context parameter names by entering a variable name separately, e.g. $contextvariable
- Later on in the IVR, you can build logic on such variables. As an example, in an IF process, you can check whether $contextvariable.humanagent LIKE yes is true and then navigate the customer to a queue in VCC’s IVR.
Use Dialogflow ES Parameters on the Agent Script
On an agent script, you can use the Script JS SDK to reference variables that you used to store Dialogflow ES parameters.
You can create a function in the following way to get the variable: vcc.getScriptVariable(‘global.ivr.variable’) where ‘variable’ is what you have defined in your IVR process.
Related articles
There's always more to learn. Discover similar features by visiting related articles:
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.