0% found this document useful (0 votes)
6 views

github-com-GoogleC...-1

Uploaded by

Mahmoud Ramadan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

github-com-GoogleC...-1

Uploaded by

Mahmoud Ramadan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Sign in

GoogleCloudPlatform / dialogflow-integrations Public

Dialogflow integrations with multiple platforms including KIK, Skype, Spark, Twlio, Twitter and
Viber

cloud.google.com/dialogflow/

Apache-2.0 license

260 stars 511 forks Branches Tags Activity

Star Notifications

Code Issues 51 Pull requests 43 Actions Projects Security

master Go to file Code

vdlima Fix-allowlisting-check (#264) e4ef349 · 2 weeks ago

botlib Convert queryParameter.payload from js… 5 years ago

cm fix readme typos last year

cx Merge pull request #227 from josobar/… last year

dialogflow-api-quick-start Update README.md 4 years ago

dialogflow-messenger Merge branch 'master' of https://github.… 3 years ago

kik fix readme typos last year

salesforce corrected path of Dialogflow examples 4 years ago

servicenow ServiceNow ES cleanup last year

skype fix readme typos last year

spark Update spark/README.md last year

View all files

README Apache-2.0 license


Dialogflow Integration

Introduction
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.

Initial Setup

Setting up gcloud CLI


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.

1. On the gcloud CLI documentation page, select your OS and follow the instructions
for the installation.
2. Run gcloud config get-value project to check the GCP Project configured.
3. Go into the Dialogflow agent’s settings and check the Project ID associated with
the agent. The GCP Project configured in the gcloud CLI should match the agent’s
Project ID.
4. If the project IDs do not match, run gcloud config set project PROJECT-ID ,
replacing PROJECT-ID with the Project ID from step 3.

Service Account Setup (GCP)


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.

1. Go into the Dialogflow agent’s settings and click on the Project ID link to open its
associated GCP Project.
2. Click on the navigation menu in the GCP console, hover over "IAM & admin", and
click "Service accounts".
3. Click on "+ CREATE SERVICE ACCOUNT", fill in the details, and give it the
"Dialogflow API Client" role.

If deploying this integration outside of GCP, you may authenticate using a key file.
Deploying on Cloud Run or Cloud Functions obviates this process.

1. Click on "+ Create Key" and download the resulting JSON key file.
2. Save the JSON key file in the desired platform subdirectory.
3. Set the GOOGLE_APPLICATION_CREDENTIALS environmental variable on the
deployment environment to the absolute path of Service Account JSON key file.
See this guide for details.

Deploying the Integration

Setup
1. Go into the Dialogflow agent’s settings and click on the Project ID link to open its
associated GCP Project.
2. Click on the navigation menu in the GCP console and click "Billing". Set up and
enable billing for the project.
3. Enable Cloud Build and Cloud Run API for the project here.
4. Clone this git repository onto your local machine or development environment:
git clone [repository url]

5. Open the root directory of the repository on your local machine or development
environment.

Dockerfile and Creating the Build


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.

Platform-specific Instructions
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:

CM.com (SMS and WhatsApp Business)


Kik
Skype
Spark
Twilio IP Messaging
Twilio (Text Messaging)
Twitter
Viber

Post-deployment

Shutting Down an 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

Multiple Integrations
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.
Changing Integration Behavior
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.

Releases

No releases published

Packages

No packages published

Contributors 17

+ 3 contributors

Languages

JavaScript 70.8% TypeScript 15.1% Jupyter Notebook 12.2% Other 1.9%

Terms Privacy Security Status Docs Contact Manage cookies Do not share my personal information

© 2024 GitHub, Inc.

You might also like