Dialogflow integrations with multiple platforms including KIK, Skype, Spark, Twlio, Twitter and Viber
The purpose of this documentation is to set up an integration deployment to connect your existing Dialogflow agent to various third party chat service platforms.
If you do not have an existing Dialogflow agent, you can set one up by reading the documentation here.
Although it is possible to set up this integration deployment on any hosting platform, these instructions will use Google's Cloud Run.
The deployment process for GCP Cloud Run via this README utilizes gcloud CLI commands. Follow the steps below to set up gcloud CLI locally for this deployment.
gcloud config get-value projectto check the GCP Project configured.
gcloud config set project PROJECT-ID, replacing PROJECT-ID with the Project ID from step 3.
For the integration to function properly, it is necessary to create a Service Account in your agent’s GCP Project. See this page of the documentation for more details.
Follow the steps below to create a Service Account and set up the integration.
If deploying this integration outside of GCP Cloud Run, it may be necessary to set the GOOGLEAPPLICATIONCREDENTIALS environmental variable on the deployment environment to the absolute path of Service Account JSON key file. See this guide for details.
git clone [repository url]
Open the Dockerfile in the root directory of the repository, and change YOUR_INTEGRATION in the following line to the name of the desired platform subdirectory.
# Set this environmental variable to the integration you want to use ENV INTEGRATION=YOUR_INTEGRATION
If you have not done so already, copy your Service Account JSON key file to the desired platform subdirectory.
The integration requires platform credentials from the intended platform to function properly.
Follow the steps in the README file in the relevant platform subdirectory to obtain the credentials and setup the server.js file to deploy and start the integration:
In order to shut down an integration set up via the steps in this README, only deleting the Cloud Run service is required.
In your local terminal, run the following command and select the previously chosen target platform to list active deployments:
gcloud beta run services list
Then run the following command, replacing SERVICE-NAME with the name of the service you want to shut down, and select the same settings chosen when deploying in order to shut down the deployment.
gcloud beta run services delete SERVICE-NAME
If following the instructions closely, SERVICE-NAME should be in the format of dialogflow-PLATFORM
To set up multiple integration deployments simultaneously, repeat all of the instructions for each deployment. While it is possible to make changes to the existing deployment repository and re-deploy it under a different name, it would make it difficult to retroactively make changes to previous deployments.
The behavior of an integration can be customized via the addition of your own developer code or by editing the server.js file in the platform subdirectory.
After making changes, redeploy the deployment by re-running the commands as specified in the "Deploy the Integration Using Cloud Run" section of the platform-specific integration READMEs.