GlobalIntentEvent
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
กำหนดเครื่องจัดการ Intent ร่วม เหตุการณ์ Intent ส่วนกลางกำหนดขอบเขตไว้สำหรับโปรเจ็กต์ Actions ทั้งหมด และอาจลบล้างโดยตัวแฮนเดิล Intent ในโหมดหนึ่งๆ ชื่อ Intent ต้องไม่ซ้ำกันภายในโปรเจ็กต์การดำเนินการ
คุณจับคู่ Intent ส่วนกลางได้ทุกเมื่อในระหว่างเซสชัน ซึ่งทำให้ผู้ใช้เข้าถึงขั้นตอนทั่วไป เช่น "รับความช่วยเหลือ" ได้ หรือ "กลับไปหน้าแรก" นอกจากนี้ยังใช้เพื่อทํา Deep Link ผู้ใช้ไปยังขั้นตอนที่เฉพาะเจาะจงเมื่อผู้ใช้เรียกใช้การดําเนินการได้ด้วย
โปรดทราบว่าชื่อ Intent จะระบุไว้ในชื่อไฟล์
การแสดง YAML |
transitionToScene: string
handler:
object (EventHandler ) |
ช่อง |
transitionToScene |
string
ไม่บังคับ ฉากปลายทางที่การสนทนาควรข้ามไป สถานะของฉากปัจจุบันจะถูกทำลายเมื่อเปลี่ยน
|
handler |
object (EventHandler )
ไม่บังคับ ตัวแฮนเดิลเหตุการณ์ซึ่งทริกเกอร์เมื่อตรงกับ Intent ควรดำเนินการก่อนเปลี่ยนเป็นโหมดปลายทาง มีประโยชน์ในการสร้างพรอมต์เพื่อตอบกลับเหตุการณ์
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eGlobal intent handlers are defined in YAML and manage intents for the entire Actions project, potentially overridden by scene-specific handlers.\u003c/p\u003e\n"],["\u003cp\u003eThese intents enable users to access universal flows like help or home and facilitate deep linking into specific parts of the Action.\u003c/p\u003e\n"],["\u003cp\u003eA global intent handler can optionally transition to a specified scene, discarding the current scene's state, and trigger an event handler for prompt generation.\u003c/p\u003e\n"]]],[],null,["# GlobalIntentEvent\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n\nDefines a global intent handler. Global intent events are scoped to the entire Actions project and may be overridden by intent handlers in a scene. Intent names must be unique within an Actions project.\n\nGlobal intents can be matched anytime during a session, allowing users to access common flows like \"get help\" or \"go back home.\" They can also be used to deep link users into specific flows when they invoke an Action.\n\nNote, the intent name is specified in the name of the file.\n\n| YAML representation ||\n|--------------------------------------------------------------------------------------------------------------------|---|\n| ``` transitionToScene: string handler: object (/assistant/actionssdk/reference/rest/Shared.Types/EventHandler) ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `transitionToScene` | `string` Optional. Destination scene which the conversation should jump to. The state of the current scene is destroyed on the transition. |\n| `handler` | `object (`[EventHandler](/assistant/actionssdk/reference/rest/Shared.Types/EventHandler)`)` Optional. Event handler which is triggered when the intent is matched. Should execute before transitioning to the destination scene. Useful to generate Prompts in response to events. |"]]