会話型アクションのサポートは 2023 年 6 月 13 日に終了しました。詳細については、
会話型アクションの廃止をご覧ください。
ConditionalEvent
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
true 条件の結果としてトリガーされるイベントを登録します。
YAML 表現 |
condition: string
transitionToScene: string
handler:
object (EventHandler ) |
フィールド |
condition |
string
必須。このイベントをトリガーするフィルタ条件。条件が true と評価されると、関連する handler がトリガーされます。次の変数参照がサポートされています。$session - セッション ストレージのデータを参照します。$user - ユーザー ストレージのデータを参照します。次のブール演算子がサポートされています(例あり): && - session.params.counter > 0 && session.params.counter < 100 || - session.params.foo == "John" || session.params.counter == "Adam" ! - !(session.params.counter == 5) 次の比較がサポートされています: == 、!= 、< 、> 、<= 、>= 次のリスト演算子と文字列演算子がサポートされています(例あり): in - "ウォーターメロン"(session.params.fruitList 、size ~size(session.params.fruitList) > 2 substring ~session.params.fullName.contains("John") )
|
transitionToScene |
string
省略可。関連する条件が true と評価されたときに会話がジャンプする宛先シーン。現在のシーンの状態は、遷移時に破棄されます。
|
handler |
object (EventHandler )
省略可。関連付けられた条件が true に評価されたときにトリガーされるイベント ハンドラ。デスティネーション シーンに移行する前に実行する必要があります。イベントに応答してプロンプトを生成するのに役立ちます。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 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. |"]]