Google Dialogflow CX

Introduction

A Dialogflow CX agent is a virtual agent that handles multiple conversations with the end-users. It is a Natural Language Understanding (NLU) module that understands the nuances of human language. You design and build a Dialogflow agent to handle different types of conversations required for your system.

For more information on Dialogflow CX, please visit - Dialogflow CX documentation | Google Cloud

📘

Note

We are using v3 Dialogflow APIs for integration with the Webex Connect platform.

Authorization

By selecting the Method as Detect Intent, you can select or add authorization.


To configure a new authorization, you should enter the Client Id and Client secret of their GCP project. This can be created within APIs and services > Credentials > Create Credentials > OAuth client Id. Under ‘Create OAuth Client ID’ select Application Type as ‘Web application’ and add Webex Connect redirect URL mentioned within the Add authorization pop-up in Dialogflow CX node.

📘

Note

For more details on how to add authorization on Google Dialogflow CX, refer to the (Dialogflow CX setup and cleanup | Google Cloud)

Please make sure your applications, firewalls, etc. do not restrict access to these new Callback URLs in case you have an internal policy or practice to add these URLs to the allow/accept/allowed list.

The authorization configured is OAuth 2.0 with Google Cloud Platform, where you will be prompted to sign in with your Gmail account.

Configuring OAuth Consent Screen

You must configure the following in the OAuth consent screen:

  1. Enter App name and User support email in the App information section.
  2. Click Save and Continue.
  • Publishing Status - Select the relevant status. The available options are:
    • Testing - indicates that the app is still in the testing phase. In this status the number of users is limited up to 100.
    • In production - indicates that the app is published and is available in production. In this status any user with a Google account can access the app. Based on the configuration of your app, additional verification may be required.
  • User Type - The available options are:
  • External - Based on the publishing status, any user with a Google account can access the app. It is mandatory to select external.
  • Internal - App is only available to internal users within your organization.
  1. Scopes - To configure scopes, click here. Click Save and Continue.

Agent Handover - Dialogflow CX – Detect Intent

Agent Handover is the process of transferring an end-user conversation from a Dialogflow virtual agent to a human agent. The transfer from virtual agent to human agent can be done when a user triggers intents.

To create an intent:

  1. Log in to the Dialogflow CX using your valid Gmail credentials.
    The following screen is displayed.
  1. Select the existing project from the list or click New Project.
  2. Once the existing project is selected, the Agents page is displayed.
  1. Do one of the following:

    • Select the existing agent from the list.
    • Use pre-built agents.
    • Create an agent by clicking Create agent.
  2. Once you have selected an existing agent or created an agent, the Dialogflow CX flow builder page is displayed.

  3. Click Manage.
    The Intents page is displayed.

  4. Click Create for creating an intent.

  1. Fill in the details and click Save. The Intent is created and displayed in the list of intents. In the following image, agent.handover is created as an intent for handing over to a live agent.

Example :

Once the intent is created, you can add the training phrases.

To add training phrases:

  1. Navigate to the Intents page.
  2. Click the intent for which you want to add the training phrases.
  3. Under the Training Phrases section, type a phrase and press Enter or click Add, as shown in the following example.

The training phrases are identified by the Dialogflow by intent.displayname and message body.

Example Screenshots to configure agent handover:

Following is the list of Input Variables, Output Variables and Node Outcomes that will be used within Dialogflow CX node:

Input VariablesOutput VariablesNode OutcomesVersions
Project – contains the list of the projects created within your Dialogflow CX. If you want to use a different project for every execution, choose 'Dynamic' and specify the variable with the project Id.

Location – contains the location of the agent

Agent Name – contains the list virtual agents within your Dialogflow CX. If you want a different agent for every execution, choose 'Dynamic' and specify the variable with the Agent Id.

Session ID – contains the details of the session Id to maintain the context of the conversation with the Dialogflow CX agent. Each conversation is determined uniquely by a session Id. It is a string of 36 bytes in size.

Language – The language of the conversation with the CX agent. Select 'Dynamic' to specify the language code at the runtime example 'en-US'.

Input Message - Input text to be processed to CX agent. Message length must not exceed 256 characters.

Add Query Parameters (Toggle Button) - to send query parameters to Dialogflow ES

Complete Object - Select this to pass the total JSON object at one go i.e a variable that contains the JSON.

Note: When a JSON object is pasted in the Query Parameter JSON Object, the replacement of values by variables is not supported in runtime of the flow. It is mandatory to add a JSON object or a variable before the a node is created.

Individual Parameters - Select this to configure each object and pass the parameters individually
responseId – contains the unique identification number for the response

userResponse – contains the details of the response from the user

languageCode – contains the code details of the language

agentResponse - contains the details of the response from the agent

currentPageName – contains the details of the current page name

currentPageDisplayName - contains the details of the current page display name

intentName – contains the unique name for the intent

intentDisplayName – contains the details of display name for the intent

intentDetectionConfidence - displays the confidence returned by the dialogflow for the intent recognition.

triggeredTransitionNames - Triggered transition route Id.

executionSequence - contains the list of array of execution

alternativeMatchedIntents - contains the next recognised intent by dialogflow

transitionTargetsChain - Page Id of the current page of dialog flow

sessionId – contains the details of the session id

match - contains the information of matched intent, type of match and confidence of the current match.

responseType – contains the details of response provided

responsePayload – contains the details of the response payload
onInvalidData

onError

onInvalidChoice

onTimeout

onauthorizationfail

detectIntentOnSuccess

detectIntentOnError
v1.0