xref: /aosp_15_r20/external/googleapis/google/actions/sdk/v2/interactionmodel/prompt/static_prompt.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.prompt;
18
19import "google/actions/sdk/v2/interactionmodel/prompt/content/static_canvas_prompt.proto";
20import "google/actions/sdk/v2/interactionmodel/prompt/content/static_content_prompt.proto";
21import "google/actions/sdk/v2/interactionmodel/prompt/content/static_link_prompt.proto";
22import "google/actions/sdk/v2/interactionmodel/prompt/static_simple_prompt.proto";
23import "google/actions/sdk/v2/interactionmodel/prompt/suggestion.proto";
24import "google/actions/sdk/v2/interactionmodel/prompt/surface_capabilities.proto";
25import "google/api/field_behavior.proto";
26
27option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/interactionmodel/prompt;prompt";
28option java_multiple_files = true;
29option java_outer_classname = "StaticPromptProto";
30option java_package = "com.google.actions.sdk.v2.interactionmodel.prompt";
31
32// Represents a list of prompt candidates, one of which will be selected as the
33// prompt to be shown in the response to the user.
34// **This message is localizable.**
35message StaticPrompt {
36  // Represents a static prompt candidate.
37  message StaticPromptCandidate {
38    // Represents structured responses to send to the user, such as text,
39    // speech, cards, canvas data, suggestion chips, etc.
40    message StaticPromptResponse {
41      // Optional. The first voice and text-only response.
42      StaticSimplePrompt first_simple = 2 [(google.api.field_behavior) = OPTIONAL];
43
44      // Optional. A content like a card, list or media to display to the user.
45      StaticContentPrompt content = 3 [(google.api.field_behavior) = OPTIONAL];
46
47      // Optional. The last voice and text-only response.
48      StaticSimplePrompt last_simple = 4 [(google.api.field_behavior) = OPTIONAL];
49
50      // Optional. Suggestions to be displayed to the user which will always
51      // appear at the end of the response. If the `append` field in the
52      // containing prompt is `true` the titles defined in this field will be
53      // added to titles defined in any previously defined suggestions prompts
54      // and duplicate values will be removed.
55      repeated Suggestion suggestions = 5 [(google.api.field_behavior) = OPTIONAL];
56
57      // Optional. An additional suggestion chip that can link out to the associated app
58      // or site.
59      // The chip will be rendered with the title "Open <name>". Max 20 chars.
60      StaticLinkPrompt link = 6 [(google.api.field_behavior) = OPTIONAL];
61
62      // Optional. Mode for how this messages should be merged with previously defined
63      // messages.
64      // `true` will clear all previously defined messages (first and last
65      // simple, content, suggestions link and canvas) and add messages defined
66      // in this prompt. `false` will add messages defined in this prompt to
67      // messages defined in previous responses. Setting this field to `false`
68      // will also enable appending to some fields inside Simple prompts, the
69      // Suggestions prompt and the Canvas prompt (part of the Content prompt).
70      // The Content and Link messages will always be overwritten if defined in
71      // the prompt. Default value is `false`.
72      bool override = 7 [(google.api.field_behavior) = OPTIONAL];
73
74      // A response to be used for interactive canvas experience.
75      StaticCanvasPrompt canvas = 8;
76    }
77
78    // Optional. The criteria for whether this prompt matches a request. If the selector
79    // is empty, this prompt will always be triggered.
80    Selector selector = 1 [(google.api.field_behavior) = OPTIONAL];
81
82    // The prompt response associated with the selector.
83    StaticPromptResponse prompt_response = 2;
84  }
85
86  // Defines the criteria for whether a prompt matches a request.
87  message Selector {
88    // The set of required surface capabilities.
89    SurfaceCapabilities surface_capabilities = 1;
90  }
91
92  // The list of candidate prompts to be sent to the client. Each prompt has a
93  // selector to determine when it can be used. The first selector that matches
94  // a request will be sent and the rest will be ignored.
95  repeated StaticPromptCandidate candidates = 1;
96}
97