對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
動作套件 (Dialogflow)
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如有需要,您可以使用 Actions SDK 建立本地化動作
每個語言代碼的動作套件,然後將這些套件上傳至 Actions 專案
使用 gactions
工具。
如要使用 Actions SDK 建立本地化動作,請按照下列步驟操作:
- 針對您想支援的每個語言代碼建立個別的動作套件。
為各個語言提供本地化名稱,例如
action.de.json
和 action.en.json
。
您也可以在專案中建立子目錄
本地化動作套件和其他資源檔案。
- 在使用語言的動作套件頂端新增
locale
元素
目標語言。此外,請提供本地化查詢
觸發動作的模式,這樣使用者就能正確觸發動作
使用的語言。例如:{
"locale": "de",
"actions": [
{
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"<Insert German query patterns here>"
]
}
}
}
]
}
- 使用
gactions
工具上傳
動作套件至 Actions 專案,指定各個本地化版本
動作套件。例如:./gactions update --project my-project-id --action_package action.de.json --action_package action.en.json --action_package action.fr.json --action_package action.ja.json --action_package action.ko.json
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[[["\u003cp\u003eOAuth and Google Sign-In linking combines Google's authentication with custom logins for flexibility.\u003c/p\u003e\n"],["\u003cp\u003eThis linking type is ideal for Actions needing cross-platform functionality and support for non-Google accounts.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create accounts using their Google profile, link existing accounts, or sign in with other providers.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can choose between authorization code or implicit flow based on security and implementation complexity.\u003c/p\u003e\n"],["\u003cp\u003eAccount linking flows adapt based on service settings and user accounts to create secure and personalized experiences.\u003c/p\u003e\n"]]],[],null,["# Action packages (Dialogflow)\n\nYou can create localized Actions with the Actions SDK by creating separate\nAction packages for each locale and then uploading them to your Actions project\nwith the `gactions` tool.\n\nTo create localized Actions with the Actions SDK:\n\n1. Create separate Action packages for each locale that you want to support, giving them localized names such as `action.de.json` and `action.en.json`. Alternatively, you can create subdirectories in your project for your localized Action packages and other resource files.\n2. Add the `locale` element at the top of your Action package with the language or locale that you want to support. In addition, provide localized query patterns for your Actions, so that users can trigger them properly for the locale they are in. For example: \n\n ```text\n {\n \"locale\": \"de\",\n \"actions\": [\n {\n \"intent\": {\n \"name\": \"actions.intent.MAIN\",\n \"trigger\": {\n \"queryPatterns\": [\n \"\u003cInsert German query patterns here\u003e\"\n ]\n }\n }\n }\n ]\n }\n ```\n3. Use the [`gactions`](/assistant/df-asdk/actions-sdk/gactions-cli) tool to upload your Action packages to your Actions project, specifying each of your localized Action packages. For example: \n\n ```\n ./gactions update --project my-project-id --action_package action.de.json --action_package action.en.json --action_package action.fr.json --action_package action.ja.json --action_package action.ko.json\n ```"]]