View Categories

VoiceBot Dialogflow Setup

3 min read

In this documentation you find information on how to configure your Dialogflow agent, including step-by-step instructions for setting up the required settings.

Requirements for setup:

  • Active Dialogflow account
  • Existing Dialogflow agent

Configuration of the Dialogflow agent

Within the configuration of your Dialogflow agent, it is important to define start and endpoint of the conversation.

startpoint of conversationendpoint of conversation
For transmitting the start information, please include the event “tenios_start” into your “Welcome Intent”:
To define the endpoint/s of your conversation, please open the end intent/s and activate the following setting:

Transmission of Dialogflow events

The VoiceBot block starts with creating a new Dialogflow session, and then immediately sends the tenios start event (e.g. tenios_start) with the following parameters:

Parameter Type Description
callUuid String The UUID of the phone call, without the last 8 hex digits.
loopCount Number For the start event, this is always 0.

    Dialogflow Events can carry parameters. In the Dialogflow Fulfillment Webhook request, they look like:

 

{
   "responseId": "ea3d77e8-ae27-41a4-9e1d-174bd461b68c",
   "session": "projects/your-agents-project-id/agent/sessions/88d13aa8-2999-4f71-b233-39cbf3a824a0",
   "outputContexts": [
      {
         "name": "projects//your-agents-project-id/agent/sessions/88d13aa8-2999-4f71-b233-39cbf3a824a0/contexts/tenios_loop",
         "parameters": {
            "callUuid": "b860c128-7808-453e-925d-b880",
            "loopCount": 2
         }
      }
   ]
}

How you access them from your Dialogflow Webhook, depends on the language and library you use.

Transmission of Caller Number

In order to use the caller number for dialog or fulfillment, at the beginning the callUuid is transmitted within the event (see above). By integrating the TENIOS Voice API, the caller number can be retrieved via a separate process using the “Call https-Posts” feature. For this purpose a request with the call information is sent to the customer’s URL at the beginning of the call. For more information visit API Call https-Posts.

Missing voice input by caller / silence (error case no-Input)
Contrary to the implementation via the Google Assistant, there is no “repromt” or default intent in Dialogflow for the handling in case of missing speech input or silence by the user. Dialogflow always requires a speech or intent input. Otherwise Dialogflow transmits an empty text (query output = ” “) to which no speech output can be sent. In this case, TENIOS transmits the event “tenios_noinput” to control a matching intent. Therefore you can create your own intent in the “Intents” tab of Dialogflow. If no individual intent is stored, the default intent is selected in Dialogflow.  
Voice output / TTS / SSML
The voice output from Dialogflow to the caller is realized via TTS (Text-to-Speech). Dialogflow transmits the text for voice output to the TENIOS VoiceBot Connector, which is then converted into audio via TTS and replayed by telephone. You can define the desired language by yourself in the portal. You can also use SSML for the voice output (TTS). Please note the information under www.tenios.de/en/doc/announcements.

Settings in Dialogflow

Step-by-step instructions
Login to your Dialogflow account and open the page “Settings > Speech” and deactivate the function “Automatic Text to Speech”:

 

Afterwards go to “General” and click on the link “Google Cloud” to open the Google Cloud Plattform for your project: Dialogflow Settings   Select “Roles” by clicking on the menu item.

Please click “CREATE ROLE” in order to define a new role:

Create Role Dialogflow

Now enter a meaningful “Title” and a “Description”, the “ID” and the “Role launch stage”. Click the button “ADD PERMISSIONS”:

Dialogflow Create Role

A modal window will open:

Add permissions Dialogflow

Now enter ‘dialogflow.intents.list’ in “Filter table” input, select the found permission and press the “ADD” button.

Add Permissions

Repeat these steps for “dialogflow.sessions.detectIntent” permission:

Add permissions

Also add the permission for “dialogflow.sessions.streamingDetectIntent”:

StreamingDetect

Afterwards add the permission for “actions.agent.get”:

dialogflow get agent

By clicking the „CREATE“ button, the configuration of the new role is completed:

Permissions DF

Open the “Service accounts” page by clicking on the menu item and click “CREATE SERVICE ACCOUNT”. Enter the “Service account name” and create the account:

Select the role created in the previous steps and press “CONTINUE”:

Role

Please open the overview of “Service accounts”. Click the three points in the tab “Actions” next to your account. A pop-up window will open. Now select the menue item “CREATE KEY”.

Create Key Dialogflow A new window will open.

As Key type please select JSON and click “CREATE”.

Dialogflow JSON

Your browser should start downloading the JSON file, which must be saved. Afterwards the window can be closed:

JSON

To complete the configuration in Dialogflow, please press “DONE”.

Complete configuration Dialogflow

Afterwards login to the TENIOS customer portal and follow the instructions here.
TOP