แพ็กเกจการดำเนินการ (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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-08 UTC
[null,null,["อัปเดตล่าสุด 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 ```"]]