ConditionalEvent
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Doğru bir koşul sonucu tetiklenen etkinlikleri kaydeder.
YAML temsili |
condition: string
transitionToScene: string
handler:
object (EventHandler ) |
Alanlar |
condition |
string
Zorunlu. Bu etkinliğin tetikleneceği filtre koşulu. Koşul doğru olarak değerlendirilirse ilişkilendirilmiş handler tetiklenir. Şu değişken referansları desteklenir: $session : Oturum depolama alanındaki verilere başvurmak için. $user : Kullanıcı depolama alanındaki verilere referans verme. Şu boole operatörleri desteklenir (örneklerle): && - session.params.counter > 0 && session.params.counter < 100 || - session.params.foo == "John" || session.params.counter == "Adam" ! - !(session.params.counter == 5) Şu karşılaştırmalar desteklenir: == , != , < , > , <= , >= Aşağıdaki liste ve dize operatörleri desteklenir (örneklerle): in - "Karpuz" session.params.fruitList size - size(session.params.fruitList) > 2 substring - session.params.fullName.contains("John") içinde
|
transitionToScene |
string
İsteğe bağlı. İlişkili koşul doğru olarak değerlendirildiğinde ileti dizisinin atlanması gereken hedef sahne. Geçerli sahnenin durumu geçişte yok olur.
|
handler |
object (EventHandler )
İsteğe bağlı. İlişkili koşul true ile değerlendirildiğinde tetiklenen etkinlik işleyici. Hedef sahneye geçişten önce yürütülmelidir. Etkinliklere yanıt olarak istem oluşturmak için kullanışlıdır.
|
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003eYAML is used to represent events that are triggered based on a true condition.\u003c/p\u003e\n"],["\u003cp\u003eEvents can be triggered based on conditions using variables like \u003ccode\u003e$session\u003c/code\u003e and \u003ccode\u003e$user\u003c/code\u003e, boolean operators, and comparisons.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, you can define a destination scene for the conversation to jump to when the condition is true.\u003c/p\u003e\n"],["\u003cp\u003eEvent handlers can be defined to execute before transitioning to a new scene, allowing for the generation of prompts.\u003c/p\u003e\n"]]],[],null,["# ConditionalEvent\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n\nRegisters events that trigger as the result of a true condition.\n\n| YAML representation ||\n|--------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` condition: string transitionToScene: string handler: object (/assistant/actionssdk/reference/rest/Shared.Types/EventHandler) ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `condition` | `string` Required. Filter condition for this event to trigger. If condition is evaluated to true then the associated `handler` will be triggered. The following variable references are supported: `$session` - To reference data in session storage. `$user` - To reference data in user storage. The following boolean operators are supported (with examples): `&&` - `session.params.counter \u003e 0 && session.params.counter \u003c 100` `||` - `session.params.foo == \"John\" || session.params.counter == \"Adam\"` `!` - `!(session.params.counter == 5)` The following comparisons are supported: `==`, `!=`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=` The following list and string operators are supported (with examples): `in` - \"Watermelon\" in `session.params.fruitList` `size` - `size(session.params.fruitList) \u003e 2` `substring` - `session.params.fullName.contains(\"John\")` |\n| `transitionToScene` | `string` Optional. Destination scene which the conversation should jump to when the associated condition is evaluated to true. 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 associated condition is evaluated to `true`. Should execute before transitioning to the destination scene. Useful to generate Prompts in response to events. |"]]