Conversational Agents (Dialogflow CX)'s Google Chat Integration lets you create Google Chat apps with natural language understanding based on Conversational Agents (Dialogflow CX) technology.
Limitations
- Only text input in the agent's default language is supported by this integration.
Set up Google Chat
In order to set up the Google Chat integration for your agent, you'll need the following:
- A Google Workspace account with access to Google Chat.
- A Google Cloud project.
Enable the Google Chat API
Before using Google APIs, you need to turn them on in a Google Cloud project. You can turn on one or more APIs in a single Google Cloud project.
In the Google Cloud console, enable the Google Chat API and the Dialogflow API.
Confirm that you're enabling the APIs in the correct Cloud project, then click Next.
Confirm that you're enabling the correct APIs, then click Enable.
Set up from Conversational Agents (Dialogflow CX)
- Go to the Dialogflow CX console.
- Choose your Google Cloud project.
- Select your agent.
- Select the Manage tab.
- Click Integrations in the left sidebar menu.
- Click Connect on Google Chat.
- Fill in the following required information:
- Name: The name displayed to users who interact with or consume content created by this app, such as in messages, search, and @mentions. For example
Conversational Agents (Dialogflow CX) App
. - Avatar URL: The avatar image which is displayed to users who interact with the app. Specify an HTTPS URL that hosts a square (aspect ratio of 1:1) PNG image. Recommended minimum size: 256 by 256 pixels. For example
https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png
. - Description: A description of the app. For example,
A helpful bot that responds to real human conversation
.
- Name: The name displayed to users who interact with or consume content created by this app, such as in messages, search, and @mentions. For example
- Choose an Environment as applicable.
- Enter email addresses to make this Chat app available to specific people and groups as applicable.
- Click Start.
Testing
To test your configured app, mention it in a Google Chat space or send it a DM. For example,
- Open Google Chat.
- Click New chat.
- In the Add 1 or more people field, type the name of your Chat app.
- Select your Chat app from the results. A direct message opens.
Rich response messages
The rich response messages are supported using Custom Payload in Fulfillment. See Google Chat message API for the message format.
Text message
The following custom payload provides a Google Chat text message:
{ "text": "Hello, world" }
Card message
The following custom payload provides a Google chat card message:
{ 'cardsV2': [{ 'cardId': 'createCardMessage', 'card': { 'header': { 'title': 'A card message!', 'subtitle': 'Sent from Conversational Agents (Dialogflow CX)', 'imageUrl': 'https://developers.google.com/chat/images/chat-product-icon.png', 'imageType': 'CIRCLE' }, 'sections': [ { 'widgets': [ { 'buttonList': { 'buttons': [ { 'text': 'Read the docs!', 'onClick': { 'openLink': { 'url': 'https://developers.google.com/workspace/chat' } } } ] } } ] } ] } }] }
Channel-specific responses
When configured, channel-specific responses with channel DF_CX_GOOGLE_CHAT
will be automatically used when the agent responds to Google Chat messages.