[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Google Chat\n\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nConversational Agents (Dialogflow CX)'s Google Chat Integration lets you create Google Chat\napps with natural language understanding based on Conversational Agents (Dialogflow CX) technology.\n\n\n| **Note:** When using a third party integration, requests and end-user data are sent to both Google and the third party. The terms of service, SLA, pricing, and quotas [for your agent edition](/dialogflow/docs/editions) are applicable for Google's handling of these requests. The third party's terms of service, SLA, pricing, and quotas are applicable for the third party's handling of these requests.\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\n- Only **text input** in the [agent's default language](/dialogflow/cx/docs/concept/agent-settings) is supported by this integration.\n\nSet up Google Chat\n------------------\n\nIn order to set up the Google Chat integration for your agent, you'll need the\nfollowing:\n\n- A [Google Workspace](https://workspace.google.com/features/) account with access to [Google Chat](https://workspace.google.com/products/chat/).\n- A [Google Cloud project](https://developers.google.com/workspace/guides/create-project).\n\n### Enable the Google Chat API\n\nBefore 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.\n\n1. In the Google Cloud console, [enable the Google Chat API and the Dialogflow API](https://console.cloud.google.com/flows/enableapi?apiid=chat.googleapis.com,dialogflow.googleapis.com).\n\n2. Confirm that you're enabling the APIs in the correct Cloud project, then click **Next**.\n\n3. Confirm that you're enabling the correct APIs, then click **Enable**.\n\n### Set up from Conversational Agents (Dialogflow CX)\n\n1. Go to the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Integrations** in the left sidebar menu.\n6. Click **Connect** on **Google Chat**.\n7. Fill in the following required information:\n - **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`.\n - **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`.\n - **Description** : A description of the app. For example, `A helpful bot that responds to real human conversation`.\n8. Choose an **Environment** as applicable.\n9. Enter **email addresses** to make this Chat app available to specific people and groups as applicable.\n10. Click **Start**.\n\nTesting\n-------\n\n| **Note:** Make sure [billing is enabled](/dialogflow/cx/docs/quick/setup#billing) on your project before testing the integration.\n\nTo test your configured app, mention it in a Google Chat space or send it a DM. For example,\n\n1. Open [Google Chat](https://chat.google.com).\n2. Click **New chat**.\n3. In the **Add 1 or more people** field, type the name of your Chat app.\n4. Select your Chat app from the results. A direct message opens.\n\n| **Note:** If you don't see your Chat app in the list of results, ensure that you've made your Chat app available to your Google Workspace account.\n\nRich response messages\n----------------------\n\nThe rich response messages are supported using **Custom Payload** in\n[Fulfillment](/dialogflow/cx/docs/concept/fulfillment). See\n[Google Chat message API](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#Message)\nfor the message format.\n| **Note:** If they are not specified in the custom payload, the Space and Thread objects will be automatically injected with the resource ID from the input message.\n\n### Text message\n\nThe following custom payload provides a Google Chat\n[text message](https://developers.google.com/workspace/chat/messages-overview#anatomy-text): \n\n```\n{\n \"text\": \"Hello, world\"\n}\n```\n\n### Card message\n\nThe following custom payload provides a Google chat\n[card message](https://developers.google.com/workspace/chat/messages-overview#anatomy-card): \n\n```\n{\n 'cardsV2': [{\n 'cardId': 'createCardMessage',\n 'card': {\n 'header': {\n 'title': 'A card message!',\n 'subtitle': 'Sent from Conversational Agents (Dialogflow CX)',\n 'imageUrl': 'https://developers.google.com/chat/images/chat-product-icon.png',\n 'imageType': 'CIRCLE'\n },\n 'sections': [\n {\n 'widgets': [\n {\n 'buttonList': {\n 'buttons': [\n {\n 'text': 'Read the docs!',\n 'onClick': {\n 'openLink': {\n 'url': 'https://developers.google.com/workspace/chat'\n }\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }\n }]\n}\n```\n\nChannel-specific responses\n--------------------------\n\nWhen configured, [channel-specific responses](/dialogflow/cx/docs/concept/fulfillment#channel-specific) with channel `DF_CX_GOOGLE_CHAT` will be automatically used when the agent responds to Google Chat messages.\n\nRelated topics\n--------------\n\n- [Build a Conversational Agents (Dialogflow CX) Google Chat app that understands and responds with natural language](https://developers.google.com/workspace/chat/build-dialogflow-chat-app-natural-language)"]]