Gói hành động (Dialogflow)
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn có thể tạo các Hành động đã bản địa hoá thông qua SDK Hành động bằng cách tạo các hành động
Các gói hành động cho từng ngôn ngữ rồi tải chúng lên dự án Actions
bằng công cụ gactions
.
Cách tạo Hành động đã bản địa hoá bằng SDK Hành động:
- Tạo các gói Hành động riêng biệt cho từng ngôn ngữ mà bạn muốn hỗ trợ,
đặt cho chúng các tên được bản địa hoá như
action.de.json
và action.en.json
.
Ngoài ra, bạn có thể tạo thư mục con trong dự án cho
đã bản địa hoá gói Hành động và các tệp tài nguyên khác.
- Thêm phần tử
locale
bằng ngôn ngữ ở đầu gói Hành động
hoặc ngôn ngữ mà bạn muốn hỗ trợ. Ngoài ra, hãy cung cấp truy vấn được bản địa hoá
cho Hành động của bạn, để người dùng có thể kích hoạt chúng một cách thích hợp cho
ngôn ngữ của thiết bị đó. Ví dụ:
{
"locale": "de",
"actions": [
{
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"<Insert German query patterns here>"
]
}
}
}
]
}
- Sử dụng công cụ
gactions
để tải
Gói hành động cho dự án Actions của bạn, chỉ định từng gói
Gói hành động. Ví dụ:
./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
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-08 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-08 UTC."],[[["\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 ```"]]