You can currently use the following integrations in Dialogflow: Facebook Messenger, Google Assistant, Phone Gateway, LINE and Slack.
By creating a Dialogflow Endpoint in COGNIGY.AI, you can utilize the power of intents in an existing Dialogflow agent with a Flow in COGNIGY.AI.
This tutorial covers the necessary steps for creating and connecting a Dialogflow Endpoint. If you want to get information about assigning a Flow to the Endpoint and setting up the Data Management see Endpoints.
Requires a Dialogflow Agent
This guide assumes that you already have a working Dialogflow Agent with intents in the Dialogflow console. If this is not the case, then you can follow this guide to create your first Dialogflow agent: Create and query your first Dialogflow agent
The Dialogflow Agent needs to use the V2 API.
1 Create a Dialogflow Endpoint in COGNIGY.AI.
2 Integrate the Dialogflow Endpoint with your Dialogflow agent
The first thing you need to do is to create a Dialogflow Endpoint in COGNIGY.AI. In order to do this, navigate to your Project, click on the button in the lower left corner and create an Endpoint.
After creating your Endpoint, you should be navigated to the Endpoint configuration of your Dialogflow Endpoint. Here you need to set the Flow that the Endpoint should point to, and you can change the NLU Connector of the Endpoint.
Per default, the Dialogflow Endpoint uses the NLU from the Dialogflow agent that you connect to the Endpoint, meaning that it will use the intents defined in your agent. You can override this behaviour by changing to another NLU Connector, either to use intents you have created in COGNIGY.AI, or to use another external NLU Connector.
If you open the Dialogflow Settings panel, you will see a setting called
Reparse Slots. If this setting is enabled (disabled per default), then the text from Dialogflow will be reparsed with COGNIGY.AI NLU in order to detect slots. This means that slots defined in any COGNIGY.AI lexicon, which you have attached to your Flow, will also be detected along with the slots found by Dialogflow. If the setting is off, then you only get the slots found by Dialogflow.
Using the COGNIGY NLU Connector
If you choose
Cognigy NLUas the NLU Connector, then the
Reparse Slotssetting will be disabled, since you are then always using COGNIGY.AI NLU to parse the sentence and find Slots.
In order to connect your Dialogflow agent to your Dialogflow Endpoint, you first have to enable Webhooks in the Dialogflow console. Do this by going to your Dialogflow agent in the console, navigating to
Fulfillment in the side menu and enabling Webhooks. After doing this, you need to copy the EndpointURL of your Dialogflow Endpoint and insert it into the URL of the Fulfillment Webhook. You can find the EndpointURL in your Dialogflow Endpoint in the COGNIGY.AI User Interface.
In order to actually send the request from Dialogflow to COGNIGY.AI, you need to enable Webhooks for all of your intents in Dialogflow. You can do this by opening each intent in the Dialogflow console, scrolling down to the Fulfillment section and enabling the setting
Enable webhook call for this intent. When this setting is enabled, Dialogflow will sent a request to your Dialogflow Endpoint when this intent is triggered.
There are two common approaches to handling conversations with Dialogflow. First, the user could start the Action by saying something like: "Ok Google, talk to my agent". Second, the user could directly trigger an intent with: "Ok Google, talk to my agent and book a hotel". For the first variation, one could use the default Welcome Intent Dialogflow provides after creating an action. The second one would need a handler on the Cognigy side.
In order to get the best out of Cognigy.AI, you don't want to maintain intents in Cognigy.AI and Dialogflow. All intents should be defined inside your Cognigy Flow. Therefore, please define the Default Welcome Intent such as the following:
Since you want to use the response which is defined in your Flow, you have to delete the Dialogflow default responses.
Furthermore, click on the GOOGLE ASSISTANT tab in the Responses section and toggle the button, so that it is on:
As soon as you start talking to your Google Assistant, it sends a specific user input text to your Cognigy Flow. Please add the following text to your Flow's welcome intent:
You have to add this example sentence to your welcome intent. Otherwise, this will not work.
If you want to use more than just the welcome message as the start of your conversation, you have to delete the whole DialogFlow welcome intent. Thus, the message is directly forwarded to Cognigy NLU. When the user now starts the conversation with "Ok Google, talk to my agent", a so-called DATA_ONLY message is sent to the Cognigy Flow. Inside your Flow, this message needs to be handled in order to provide the Welcome message.
When you have created your Fulfillment and enabled Webhooks for your intents, you can test your Dialogflow Endpoint by sending a message in the chat in the Dialogflow console. When you use the chat in the Dialogflow console or the Web Demo Integration, then your userId in COGNIGY.AI will be the project id of your Dialogflow agent, which you find in the agent settings.
Updated about 2 years ago