xref: /aosp_15_r20/external/googleapis/google/actions/sdk/v2/event_logs.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;
18
19import "google/actions/sdk/v2/conversation/intent.proto";
20import "google/actions/sdk/v2/conversation/prompt/prompt.proto";
21import "google/actions/sdk/v2/conversation/scene.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24import "google/rpc/status.proto";
25
26option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
27option java_multiple_files = true;
28option java_outer_classname = "EventLogsProto";
29option java_package = "com.google.actions.sdk.v2";
30
31// Contains information about execution event which happened during processing
32// Actions Builder conversation request. For an overview of the stages involved
33// in a conversation request, see
34// https://developers.google.com/assistant/conversational/actions.
35message ExecutionEvent {
36  // Timestamp when the event happened.
37  google.protobuf.Timestamp event_time = 1;
38
39  // State of the execution during this event.
40  ExecutionState execution_state = 2;
41
42  // Resulting status of particular execution step.
43  google.rpc.Status status = 3;
44
45  // Detailed information specific to different of events that may be involved
46  // in processing a conversation round. The field set here defines the type of
47  // this event.
48  oneof EventData {
49    // User input handling event.
50    UserConversationInput user_input = 4;
51
52    // Intent matching event.
53    IntentMatch intent_match = 5;
54
55    // Condition evaluation event.
56    ConditionsEvaluated conditions_evaluated = 6;
57
58    // OnSceneEnter execution event.
59    OnSceneEnter on_scene_enter = 7;
60
61    // Webhook request dispatch event.
62    WebhookRequest webhook_request = 8;
63
64    // Webhook response receipt event.
65    WebhookResponse webhook_response = 9;
66
67    // Webhook-initiated transition event.
68    WebhookInitiatedTransition webhook_initiated_transition = 10;
69
70    // Slot matching event.
71    SlotMatch slot_match = 11;
72
73    // Slot requesting event.
74    SlotRequested slot_requested = 12;
75
76    // Slot validation event.
77    SlotValidated slot_validated = 13;
78
79    // Form filling event.
80    FormFilled form_filled = 14;
81
82    // Waiting-for-user-input event.
83    WaitingForUserInput waiting_user_input = 15;
84
85    // End-of-conversation event.
86    EndConversation end_conversation = 16;
87  }
88
89  // List of warnings generated during execution of this Event. Warnings are
90  // tips for the developer discovered during the conversation request. These
91  // are usually non-critical and do not halt the execution of the request. For
92  // example, a warnings might be generated when webhook tries to override a
93  // custom Type which does not exist. Errors are reported as a failed status
94  // code, but warnings can be present even when the status is OK.
95  repeated string warning_messages = 17;
96}
97
98// Current state of the execution.
99message ExecutionState {
100  // ID of the scene which is currently  active.
101  string current_scene_id = 1;
102
103  // State of the session storage:
104  // https://developers.google.com/assistant/conversational/storage-session
105  google.protobuf.Struct session_storage = 2;
106
107  // State of the slots filling, if applicable:
108  // https://developers.google.com/assistant/conversational/scenes#slot_filling
109  Slots slots = 5;
110
111  // Prompt queue:
112  // https://developers.google.com/assistant/conversational/prompts
113  repeated google.actions.sdk.v2.conversation.Prompt prompt_queue = 7;
114
115  // State of the user storage:
116  // https://developers.google.com/assistant/conversational/storage-user
117  google.protobuf.Struct user_storage = 6;
118
119  // State of the home storage:
120  // https://developers.google.com/assistant/conversational/storage-home
121  google.protobuf.Struct household_storage = 8;
122}
123
124// Represents the current state of a the scene's slots.
125message Slots {
126  // The current status of slot filling.
127  google.actions.sdk.v2.conversation.SlotFillingStatus status = 2;
128
129  // The slots associated with the current scene.
130  map<string, google.actions.sdk.v2.conversation.Slot> slots = 3;
131}
132
133// Information related to user input.
134message UserConversationInput {
135  // Type of user input. E.g. keyboard, voice, touch, etc.
136  string type = 1;
137
138  // Original text input from the user.
139  string original_query = 2;
140}
141
142// Information about triggered intent match (global or within a scene):
143// https://developers.google.com/assistant/conversational/intents
144message IntentMatch {
145  // Intent id which triggered this interaction.
146  string intent_id = 1;
147
148  // Parameters of intent which triggered this interaction.
149  map<string, google.actions.sdk.v2.conversation.IntentParameterValue> intent_parameters = 5;
150
151  // Name of the handler attached to this interaction.
152  string handler = 3;
153
154  // Scene to which this interaction leads to.
155  string next_scene_id = 4;
156}
157
158// Results of conditions evaluation:
159// https://developers.google.com/assistant/conversational/scenes#conditions
160message ConditionsEvaluated {
161  // List of conditions which were evaluated to 'false'.
162  repeated Condition failed_conditions = 1;
163
164  // The first condition which was evaluated to 'true', if any.
165  Condition success_condition = 2;
166}
167
168// Evaluated condition.
169message Condition {
170  // Expression specified in this condition.
171  string expression = 1;
172
173  // Handler name specified in evaluated condition.
174  string handler = 2;
175
176  // Destination scene specified in evaluated condition.
177  string next_scene_id = 3;
178}
179
180// Information about execution of onSceneEnter stage:
181// https://developers.google.com/assistant/conversational/scenes#on_enter
182message OnSceneEnter {
183  // Handler name specified in onSceneEnter event.
184  string handler = 1;
185}
186
187// Event triggered by destination scene returned from webhook:
188// https://developers.google.com/assistant/conversational/webhooks#transition_scenes
189message WebhookInitiatedTransition {
190  // ID of the scene the transition is leading to.
191  string next_scene_id = 1;
192}
193
194// Information about a request dispatched to the Action webhook:
195// https://developers.google.com/assistant/conversational/webhooks#payloads
196message WebhookRequest {
197  // Payload of the webhook request.
198  string request_json = 1;
199}
200
201// Information about a response received from the Action webhook:
202// https://developers.google.com/assistant/conversational/webhooks#payloads
203message WebhookResponse {
204  // Payload of the webhook response.
205  string response_json = 1;
206}
207
208// Information about matched slot(s):
209// https://developers.google.com/assistant/conversational/scenes#slot_filling
210message SlotMatch {
211  // Parameters extracted by NLU from user input.
212  map<string, google.actions.sdk.v2.conversation.IntentParameterValue> nlu_parameters = 2;
213}
214
215// Information about currently requested slot:
216// https://developers.google.com/assistant/conversational/scenes#slot_filling
217message SlotRequested {
218  // Name of the requested slot.
219  string slot = 1;
220
221  // Slot prompt.
222  google.actions.sdk.v2.conversation.Prompt prompt = 3;
223}
224
225// Event which happens after webhook validation was finished for slot(s):
226// https://developers.google.com/assistant/conversational/scenes#slot_filling
227message SlotValidated {
228
229}
230
231// Event which happens when form is fully filled:
232// https://developers.google.com/assistant/conversational/scenes#slot_filling
233message FormFilled {
234
235}
236
237// Event which happens when system needs user input:
238// https://developers.google.com/assistant/conversational/scenes#input
239message WaitingForUserInput {
240
241}
242
243// Event which informs that conversation with agent was ended.
244message EndConversation {
245
246}
247