Sangoma CX Technical Guide - Google Dialogflow and Sangoma CX Google Dialogflow Connector
Introduction
Google Dialogflow, is a powerful and versatile conversational AI platform that has rapidly emerged as a leading tool for building chatbots, virtual assistants, and natural language processing applications. Dialogflow has become a go-to choice for developers and businesses seeking to create interactive and intelligent conversational interfaces.
This document aims to provide an overview of Google Dialogflow, including an exploration of its various versions, the capabilities they offer, use cases and how Sangoma CX integrates with it.
What is Google Dialogflow?
Google Dialogflow is a cloud-based, natural language understanding platform that empowers organizations to design, build, and deploy conversational interfaces and chatbots. Developed by Google, Dialogflow combines cutting-edge machine learning techniques and extensive language support to enable the creation of natural, human-like interactions between users and computer systems.
Versions of Google Dialogflow
Dialogflow offers two versions to best fulfill the needs of developers and businesses:
Dialogflow ES (Edition Standard)
Provides fundamental capabilities for building chatbots and virtual agents. It includes text and speech-based conversation support and offers integration with a range of popular platforms and services. It does not provide a workflow, so it is ideal for less advanced or less complex chatbot or virtual assistants. The cost of the service per message is lower when using this edition.
Dialogflow CX (Edition Customer Experience)
It has the same core concepts as Dialoflow ES, but includes advanced tools and a workflow designer that permits the creation of complex conversational bots and workflows. It focuses on optimizing the user experience and enables more intricate conversation design, making it well-suited for large enterprises and customer service applications.
Capabilities of Google Dialogflow
Google Dialogflow offers a range of capabilities, including:
Natural Language Understanding: Dialogflow can understand and process natural language input, making it adept at handling a wide variety of user queries.
Multi-language Support: It supports multiple languages, allowing developers to create global and multilingual chatbots and virtual agents.
Integrations: Dialogflow can seamlessly integrate with popular messaging platforms and third-party systems by invoking APIs.
Customization: Developers can train Dialogflow to understand specific terminology and phrases relevant to their applications.
Rich Responses: It supports the generation of rich, dynamic responses with images, cards, carousels, and quick replies.
Context Management: Dialogflow keeps track of conversation context, making it easier to build complex, context-aware interactions.
Generative AI: Dialogflow allows defining Generators, which allows set generative AI models to create dynamic responses or text that can be used during fulfillment.
Samples and Use Cases
Dialogflow can be applied to a wide range of use cases, including:
Customer Support Chatbots: Dialogflow can be used to create intelligent chatbots that assist customers with common queries, troubleshooting, and FAQs.
Virtual Assistants: It is an excellent tool for building virtual assistants that help users with tasks like setting reminders, checking status of a request, or providing information.
E-commerce and Retail: Dialogflow can power conversational shopping experiences, helping users find products, make purchases, and track orders.
Healthcare: It can be used for appointment scheduling, symptom checking, and general health information retrieval.
Education: Dialogflow can serve as an educational assistant, providing information and answering questions on various topics.
Sangoma CX and Google Dialoflow
The Sagoma CX Premium tier has built-in connectors that allow embedding or interconnecting with Virtual Agent Assistants or Chabtbots created in Google Dialogflow SE or CX. The connectors are designed to serve two use cases:
Agent Virtual Assistants: embeds a Dialogflow Messenger in the Agent Panel interface assisting Contact Center Agents by answering questions or automating specific tasks. The knowledge or tasks the Agent Virtual Assistants can handle, is only limited to the Dialogflow Chatbot created by customers or third parties involved in its development.
Service Chatbots: all textual-based channels supported in Sangoma CX can invoke a Dialogflow Chatbot. It is possible to specify which Dialogflow Chatbot integrates with each inbox providing the flexibility of using one Dialogflow Chatbot for all Inboxes or using a specific Dialogflow Chatbot per inbox. It is important to mention that:
Although the communication between the customer and the Dialogflow chatbot is done through Sangoma CX, the conversation only shows in Sangoma CX monitors and reports when the interaction is queued in an inbox triggered by the Handoff intent.
Sagoma CX also allows Google Dialogflow to provide information back in relation to the conversation status:
Conversation terminated by Chatbot: In this case, Sangoma CX resolves the conversation as terminated with the customer.
Conversation needs a human Agent: in this case, Sangoma CX reassigns the conversation to an available Sangoma CX Agent providing the transcript of the conversation to the assigned Agent between the customer and the Chatbot.
Configuring Agent Virtual Assistants in Sangoma CX
Sangoma CX allows enabling a Virtual Assistant created in Google Dialogflow, making it accessible to all the Agents through the Sangoma CX Agent Panel interface.
Prerequisites
The prerequisites are:
This capability is only available with a Sangoma CX Premium Tier. Please note that Google DialogFlow services are not included with this tier or provided by Sangoma.
A Google DialogFlow Chatbot created and trained to assist the Agents. If you do not have experience creating a Chatbot in Google Dialogflow, we included information in Appendix A that explains how to create an FAQ Chatbot using the Knowledge Base feature available in Google Dialogflow SE.
Configuration Steps
To configure the Virtual Agent assistant:
Log in the Sangoma CX tenant as administrator
Click System at the top of the page then Configuration in the left side menu.
In the Configuration menu, click on “Agent Virtual Assistant”, the following screen is displayed.
Click in the Agent Assistance Type field and select “Dialogflow”.
Fill out the following fields:
Title: provide the title that will show up on the Dialogflow Messenger embedded in the Agent Panel.
DialogFlow Agent ID: this information is provided by Dialogflow. The section Where to find the DialogFlow Agent ID, details its location when using Dialogflow SE and CX.
Intent: will initiate the Virtual Agent Assistant invoking a specific Intent.
Language Code: Dialogflow allows creating chatbots that support multiple languages if the Chbatbot is configured to support them. Use en-us for English US.
Save the configuration. Once saved, all Agents logging into the Agent Panel will see the Virtual Assistant icon.
Where to find the DialogFlow Agent ID
To get the DialogFlow Agent ID follow these steps.
In Dialogflow ES
Login in Dialogflow ES.
Select the Dialoflow Agent.
Click on “Integrations” and then click in the “Dialogflow Messenger” tile.
Click on the “Enable” button if it has not been clicked before, and you will see the following screen.
DialogFlow Agent ID is the string within quotes in the line that starts with agent-id=.
In Dialogflow CX
Login in Dialogflow ES.
Select the Dialoflow Agent.
The Dialogflow Agent ID is located in the URL after /agents/
Assigning a Service Chatbot to a Sangoma CX inbox
Sangoma CX interconnects any inbox with Google Dialogflow chatbots, automating fully or partially the interaction with customers. This section explains how to configure this integration in Sangoma CX and the specific configuration and information required from these chatbots.
Prerequisites
The prerequisites are:
This capability is only available on Sangoma CX Premium Tier. Please note that Google DialogFlow services are not included with this tier or provided by Sangoma.
You need to have a Digital Channel inbox configured in Sangoma CX.
A Google DialogFlow Chatbot created and trained to serve customers reaching Sangoma CX platform, using any supported textual channel, such as: Webchat, WhatsApp and Telegram. If you do not have experience creating a Chatbot in Google Dialogflow, we included in Appendix A the steps on how to create a service Chatbot importing a pre-built Agent in Google Dialogflow SE.
The Google DialogFlow Chatbot requires having two intents that will indicate to Sangoma CX if the conversation has to be terminated because it is finalized in the Dialogflow Chatbot or if the conversation needs to be captured and routed to a Sangoma CX Agent because the chatbot is not resolving successfully the inquiry with the customer. The section Adding the Handoff and Resolve Intents explains how to configure them.
Configuration Steps
To configure the Virtual Agent assistant
Log in the Sangoma CX tenant as administrator
Click System at the top of the page then Configuration in the left side menu.
In the Configuration menu, click on “Dialogflow”, the following screen is displayed
Click the button “CREATE DIALOGFLOW BOT”
Fill out the following fields:
Inbox: select the Digital Chanel inbox you want to integrate with the Chatbot.
DialogFlow Project ID: this information is provided by Dialogflow and Google Cloud Services. The Section How to get the DialogFlow Project ID and Project Key File details how you will be able to get this information.
DialogFlow Project Key File: this information is provided by Google Cloud Services. The Section How to get the DialogFlow Project ID and Project Key File details how to generate the Project Key File and get this information.
Save the configuration. Once saved the selected inbox will route conversations to the integrated Dialogflow Chatbot. Please make sure the “Handoff” and “Resolve” intents are configured in the Chatbot as indicated in section Adding the Handoff and Resolve Intents.
Adding the Handoff and Resolve Intents.
In order to ensure Sangoma CX is on Sync with the Google Dialogflow Chatbot assigned to an inbox, it requires having two intents:
Resolve Intent: this is the intent that informs Sangoma CX the conversation was finalized in the Chatbot and needs to be terminated also in Sangoma CX.
Handoff Intent: this is the intent that informs Sangoma CX the conversation needs to be assigned to a Sangoma CX Agent.
Steps for Adding the Resolve Intent
Login in Dialoflow SE, select the Dialogflow Agent to add the Intent and click on the + symbol next to “Intents”, to create a new intent.
Type “Resolve Intent” as the intent name.
Add the words or phrases that will trigger this event, for example: “Bye”, “Close”, and any other word or phrase that the customer may type to terminate the conversation.
Add a response as “Payload” with the following content.
{ “action”: “resolve” } |
Enable “Set this intent as end of conversation”.
Click the “Save” button.
Steps for Adding the Handoff Intent
Login in Dialoflow SE, select the Dialogflow Agent to add the Intent and click on the + symbol next to “Intents” to create a new intent.
Type “Handoff Intent” as the intent name.
Add the words or phrases that will trigger this event, for example: “Talk to an agent”, “Speak with an agent”, and any other word or phrase that the customer may type when trying to reach a human to handle his / her request.
Add a response as “Payload” with the following content.
{ “action”: “handoff” } |
Enable “Set this intent as end of conversation”.
Click the “Save” button.
How to get the DialogFlow Project ID and Project Key File
Steps to get the DialogFlow Project ID
Login in Dialogflow ES.
Select the Dialoflow Agent.
Click on gear next to the Agent name. The project name is visible on the right side of the screen.
Steps to generate and get the Project Key File
On the previous screen click the Project ID. This opens a new Browser tab accessing the Google Cloud Platform console. Click the menu IAM & Admin > Service Accounts.
Click “+ CREATE SERVICE ACCOUNT”.
Fill out the: Service account name, Service Account ID, and Service account description. Click the “CREATE AND CONTINUE” button.
In the combo role select “Dialogflow API Client”. Click the “CONTINUE” button.
Click the “DONE” button.
The service account we just created will be displayed, click on it.
Click on “KEYS”.
Click on “ADD KEY” and select “Create new Key”.
A modal Window will be displayed. Make sure the key type selected is JSON and click on “CREATE''. A file will download.
Click on “CLOSE”.
Open the downloaded file with a text editor. Copy all the text inside that file. That content must be copied in the field “Dialogflow Project Key File” in the “CREATE DIALOGFLOW BOT” configuration screen in Sangoma CX.
Appendix A: How to Create FAQ Chatbot and Import a Pre-built Chatbot using Dialogflow
This appendix must be considered a short guide that allows you to experiment with DialogFlow to create:
FAQ chatbots that can be used as Virtual Agent Assistants.
Sample service chatbots that resemble a specific vertical.
By no means this appendix is suggesting the information provided will allow mastering Google Dialogflow or is enough to create a production ready chatbot. Make sure you get proper training on this subject and extend your knowledge on Google Dialog Flow and Google Cloud Services by reviewing the extensive set of resources available on the Internet.
Creating a FAQ Chatbot
The easiest way to create an FAQ Chatbot is by using the Knowledge Base capabilities in Google Dialogflow ES and feed it with a FAQ file in CSV format done in Excel or Google Sheets that contains the list of Questions and Answers.
The following YouTube video details the few steps that are required to create this chatbot that can be used as Agent Virtual Assistant to resolve Agents questions: Build an FAQ bot with Dialogflow and Google Sheets
Please note:
The Chatbot is not generative and it only has a relation between Questions and Answers.
The NLU engine decides if the question typed is similar to a question loaded in the FAQ. If the NLU engine considers the match it is statistically relevant, provides the Answer stored in the FAQ.
The Chabot can be improved by fine tuning it in Dialogflow or by using more advanced capabilities available in this Google Service.
Importing a Prebuilt Chatbot
Google Dialogflow has a set of prebuilt agents that can be later, adapted to your needs. The benefit of using Pre-build Agents is that it allows you to experience and experiment with a real Chatbot in very little time and without having too much knowledge in the tool. It is a great option that enables you to jump into this subject and start learning this fascinating tool and technology using the extensive set of resources available on the Internet.
To create a Chatbot by importing a prebuilt agent, follow these steps
Login in Dialogflow CX and Click on “Prebuilt Agents”.
Browse through the extensive list of prebuilt agents.
Click the “Import” button inside the tile with the prebuilt agent you want to import.
Give it a unique name to the agent, select “Create a new Google project” in the combo and click the “CREATE AGENT FROM TEMPLATE” button.
The import process will start. This can take several minutes.
Once finished click the “GO TO AGENT” button.
If the gear is spinning, wait until it finishes. This means Dialogflow is still processing the intents and will give you an error message if you try to use it.
Now you can use the option of “try it now” that will provide details of the triggered intent, contexts, action, parameters, sentiment and diagnostic information.
You can also interact with the Chatbot using a messaging interface to test the responses, click on Integrations > Dialogflow Messenger > ENABLE.
Then click on “TRY IT NOW” and a Dialogflow Messenger widget will appear allowing you to interact with the Chatbot.
- 1 Introduction
- 2 What is Google Dialogflow?
- 3 Sangoma CX and Google Dialoflow
- 3.1 Configuring Agent Virtual Assistants in Sangoma CX
- 3.1.1 Prerequisites
- 3.1.2 Configuration Steps
- 3.1.3 Where to find the DialogFlow Agent ID
- 3.1.3.1 In Dialogflow ES
- 3.1.3.2 In Dialogflow CX
- 3.2 Assigning a Service Chatbot to a Sangoma CX inbox
- 3.1 Configuring Agent Virtual Assistants in Sangoma CX
- 4 Appendix A: How to Create FAQ Chatbot and Import a Pre-built Chatbot using Dialogflow