scene.proto 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. syntax = "proto3";
  15. package google.actions.sdk.v2.interactionmodel;
  16. import "google/actions/sdk/v2/interactionmodel/conditional_event.proto";
  17. import "google/actions/sdk/v2/interactionmodel/event_handler.proto";
  18. import "google/actions/sdk/v2/interactionmodel/intent_event.proto";
  19. import "google/actions/sdk/v2/interactionmodel/slot.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/interactionmodel;interactionmodel";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "SceneProto";
  23. option java_package = "com.google.actions.sdk.v2.interactionmodel";
  24. // Scene is the basic unit of control flow when designing a conversation. They
  25. // can be chained together with other scenes, generate prompts for the end user,
  26. // and define slots.
  27. // The scene name is specified in the name of the file.
  28. message Scene {
  29. // Handler to invoke when transitioning into this scene.
  30. EventHandler on_enter = 1;
  31. // The list of events that trigger based on intents. These events can
  32. // be triggered at any time after the on_load Handler has been called.
  33. // Important - these events define the set of intents which are scoped to
  34. // this scene and will take precedence over any globally defined events that
  35. // have the same intents or their triggering phrases. Intent names must be
  36. // unique within a scene.
  37. repeated IntentEvent intent_events = 2;
  38. // The list of events to trigger based on conditional statements. These are
  39. // evaluated after the form has been filled or immediately after on_load if
  40. // this scene does not have a form (evaluation is only done once). Only the
  41. // first matching event will be triggered.
  42. repeated ConditionalEvent conditional_events = 3;
  43. // Ordered list of slots. Each slot defines the type of data
  44. // that it will resolve and configuration to customize the experience of this
  45. // resolution (e.g. prompts).
  46. repeated Slot slots = 4;
  47. // Handler called when there is a change in state of a slot not
  48. // caused by updates within another Handler. This allows slots to be
  49. // invalidated, the scene invalidated or other changes to scene state.
  50. EventHandler on_slot_updated = 5;
  51. }