xref: /aosp_15_r20/external/googleapis/google/actions/sdk/v2/interactionmodel/scene.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.actions.sdk.v2.interactionmodel;
18
19import "google/actions/sdk/v2/interactionmodel/conditional_event.proto";
20import "google/actions/sdk/v2/interactionmodel/event_handler.proto";
21import "google/actions/sdk/v2/interactionmodel/intent_event.proto";
22import "google/actions/sdk/v2/interactionmodel/slot.proto";
23
24option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/interactionmodel;interactionmodel";
25option java_multiple_files = true;
26option java_outer_classname = "SceneProto";
27option java_package = "com.google.actions.sdk.v2.interactionmodel";
28
29// Scene is the basic unit of control flow when designing a conversation. They
30// can be chained together with other scenes, generate prompts for the end user,
31// and define slots.
32// The scene name is specified in the name of the file.
33message Scene {
34  // Handler to invoke when transitioning into this scene.
35  EventHandler on_enter = 1;
36
37  // The list of events that trigger based on intents. These events can
38  // be triggered at any time after the on_load Handler has been called.
39  // Important - these events define the set of intents which are scoped to
40  // this scene and will take precedence over any globally defined events that
41  // have the same intents or their triggering phrases. Intent names must be
42  // unique within a scene.
43  repeated IntentEvent intent_events = 2;
44
45  // The list of events to trigger based on conditional statements. These are
46  // evaluated after the form has been filled or immediately after on_load if
47  // this scene does not have a form (evaluation is only done once). Only the
48  // first matching event will be triggered.
49  repeated ConditionalEvent conditional_events = 3;
50
51  // Ordered list of slots. Each slot defines the type of data
52  // that it will resolve and configuration to customize the experience of this
53  // resolution (e.g. prompts).
54  repeated Slot slots = 4;
55
56  // Handler called when there is a change in state of a slot not
57  // caused by updates within another Handler. This allows slots to be
58  // invalidated, the scene invalidated or other changes to scene state.
59  EventHandler on_slot_updated = 5;
60}
61