GlobalIntentEvent
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mendefinisikan pengendali intent global. Peristiwa intent global tercakup dalam seluruh project Action dan dapat diganti oleh pengendali intent dalam sebuah scene. Nama intent harus unik dalam project Action.
Intent global dapat dicocokkan kapan saja selama sesi, sehingga pengguna dapat mengakses alur umum seperti "dapatkan bantuan" atau "kembali ke beranda". Fungsi ini juga dapat digunakan untuk melakukan deep link pengguna ke dalam alur tertentu saat mereka memanggil Action.
Perhatikan, nama intent ditetapkan dalam nama file.
Representasi YAML |
transitionToScene: string
handler:
object (EventHandler ) |
Kolom |
transitionToScene |
string
Opsional. Adegan tujuan yang menjadi titik awal percakapan. Status scene saat ini dihapus pada transisi.
|
handler |
object (EventHandler )
Opsional. Pengendali peristiwa yang dipicu saat intent cocok. Harus dieksekusi sebelum bertransisi ke scene tujuan. Berguna untuk membuat Prompt sebagai respons terhadap peristiwa.
|
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 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. |"]]