123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- // Copyright 2020 Google LLC
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- syntax = "proto3";
- package google.actions.sdk.v2;
- import "google/actions/sdk/v2/conversation/intent.proto";
- import "google/actions/sdk/v2/conversation/prompt/content/canvas.proto";
- import "google/actions/sdk/v2/conversation/prompt/prompt.proto";
- import "google/actions/sdk/v2/event_logs.proto";
- import "google/api/annotations.proto";
- import "google/api/client.proto";
- import "google/api/field_behavior.proto";
- import "google/protobuf/empty.proto";
- import "google/type/latlng.proto";
- option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
- option java_multiple_files = true;
- option java_outer_classname = "ActionsTestingProto";
- option java_package = "com.google.actions.sdk.v2";
- // Actions Testing API which allows developers to run automated tests.
- service ActionsTesting {
- option (google.api.default_host) = "actions.googleapis.com";
- // Plays one round of the conversation.
- rpc SendInteraction(SendInteractionRequest) returns (SendInteractionResponse) {
- option (google.api.http) = {
- post: "/v2/{project=projects/*}:sendInteraction"
- body: "*"
- };
- }
- // Finds the intents that match a given query.
- rpc MatchIntents(MatchIntentsRequest) returns (MatchIntentsResponse) {
- option (google.api.http) = {
- post: "/v2/{project=projects/*}:matchIntents"
- body: "*"
- };
- option (google.api.method_signature) = "project,query,locale";
- }
- // Sets the Web & App Activity control on a service account.
- //
- // It is necessary to have this setting enabled in order to use call Actions.
- // The setting is originally disabled for service accounts, and it is
- // preserved until set to a different value. This means it only needs to be
- // enabled once per account (and not necessarily once per test), unless it is
- // later disabled.
- //
- // Returns an error if the caller is not a service account. User accounts can
- // change this setting via the Activity Controls page. See
- // https://support.google.com/websearch/answer/54068.
- rpc SetWebAndAppActivityControl(SetWebAndAppActivityControlRequest) returns (google.protobuf.Empty) {
- option (google.api.http) = {
- post: "/v2:setWebAndAppActivityControl"
- body: "*"
- };
- option (google.api.method_signature) = "enabled";
- }
- }
- // Request for playing a round of the conversation.
- message SendInteractionRequest {
- // Required. The project being tested, indicated by the Project ID.
- // Format: projects/{project}
- string project = 1 [(google.api.field_behavior) = REQUIRED];
- // Required. Input provided by the user.
- UserInput input = 2 [(google.api.field_behavior) = REQUIRED];
- // Required. Properties of the device used for interacting with the Action.
- DeviceProperties device_properties = 3 [(google.api.field_behavior) = REQUIRED];
- // Opaque token that must be passed as received from SendInteractionResponse
- // on the previous interaction. This can be left unset in order to start a new
- // conversation, either as the first interaction of a testing session or to
- // abandon a previous conversation and start a new one.
- string conversation_token = 4;
- }
- // User input provided on a conversation round.
- message UserInput {
- // Indicates the input source, typed query or voice query.
- enum InputType {
- // Unspecified input source.
- INPUT_TYPE_UNSPECIFIED = 0;
- // Query from a GUI interaction.
- TOUCH = 1;
- // Voice query.
- VOICE = 2;
- // Typed query.
- KEYBOARD = 3;
- // The action was triggered by a URL link.
- URL = 4;
- }
- // Content of the input sent by the user.
- string query = 1;
- // Type of the input.
- InputType type = 2;
- }
- // Properties of device relevant to a conversation round.
- message DeviceProperties {
- // Possible surfaces used to interact with the Action.
- // Additional values may be included in the future.
- enum Surface {
- // Default value. This value is unused.
- SURFACE_UNSPECIFIED = 0;
- // Speaker (e.g. Google Home).
- SPEAKER = 1;
- // Phone.
- PHONE = 2;
- // Allo Chat.
- ALLO = 3;
- // Smart Display Device.
- SMART_DISPLAY = 4;
- // KaiOS.
- KAI_OS = 5;
- }
- // Surface used for interacting with the Action.
- Surface surface = 1;
- // Device location such as latitude, longitude, and formatted address.
- Location location = 2;
- // Locale as set on the device.
- // The format should follow BCP 47: https://tools.ietf.org/html/bcp47
- // Examples: en, en-US, es-419 (more examples at
- // https://tools.ietf.org/html/bcp47#appendix-A).
- string locale = 3;
- // Time zone as set on the device.
- // The format should follow the IANA Time Zone Database, e.g.
- // "America/New_York": https://www.iana.org/time-zones
- string time_zone = 4;
- }
- // Container that represents a location.
- message Location {
- // Geo coordinates.
- // Requires the [DEVICE_PRECISE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_PRECISE_LOCATION] permission.
- google.type.LatLng coordinates = 1;
- // Display address, e.g., "1600 Amphitheatre Pkwy, Mountain View, CA 94043".
- // Requires the [DEVICE_PRECISE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_PRECISE_LOCATION] permission.
- string formatted_address = 2;
- // Zip code.
- // Requires the [DEVICE_PRECISE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_PRECISE_LOCATION] or
- // [DEVICE_COARSE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_COARSE_LOCATION] permission.
- string zip_code = 3;
- // City.
- // Requires the [DEVICE_PRECISE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_PRECISE_LOCATION] or
- // [DEVICE_COARSE_LOCATION]
- // [google.actions.v2.Permission.DEVICE_COARSE_LOCATION] permission.
- string city = 4;
- }
- // Response to a round of the conversation.
- message SendInteractionResponse {
- // Output provided to the user.
- Output output = 1;
- // Diagnostics information that explains how the request was handled.
- Diagnostics diagnostics = 2;
- // Opaque token to be set on SendInteractionRequest on the next RPC call in
- // order to continue the same conversation.
- string conversation_token = 3;
- }
- // User-visible output to the conversation round.
- message Output {
- // Spoken response sent to user as a plain string.
- string text = 1;
- // Speech content produced by the Action. This may include markup elements
- // such as SSML.
- repeated string speech = 2;
- // Interactive Canvas content.
- google.actions.sdk.v2.conversation.Canvas canvas = 3;
- // State of the prompt at the end of the conversation round.
- // More information about the prompt:
- // https://developers.google.com/assistant/conversational/prompts
- google.actions.sdk.v2.conversation.Prompt actions_builder_prompt = 4;
- }
- // Diagnostics information related to the conversation round.
- message Diagnostics {
- // List of events with details about processing of the conversation round
- // throughout the stages of the Actions Builder interaction model.
- // Populated for Actions Builder & Actions SDK apps only.
- repeated ExecutionEvent actions_builder_events = 1;
- }
- // Request for finding matching intents.
- message MatchIntentsRequest {
- // Required. The project being tested, indicated by the Project ID.
- // Format: projects/{project}
- string project = 1 [(google.api.field_behavior) = REQUIRED];
- // Required. User query as plain text.
- string query = 2 [(google.api.field_behavior) = REQUIRED];
- // Required. Locale to use to evaluate the query, such as "en".
- // The format should follow BCP 47: https://tools.ietf.org/html/bcp47
- // See the list of supported languages in
- // https://developers.google.com/assistant/console/languages-locales
- string locale = 3 [(google.api.field_behavior) = REQUIRED];
- }
- // Response for finding matching intents.
- message MatchIntentsResponse {
- // Intents matched, ordered from most to least relevant. Only the first
- // 50 matches are returned.
- repeated google.actions.sdk.v2.conversation.Intent matched_intents = 1;
- }
- // Request for setting Web & App Activity preferences.
- message SetWebAndAppActivityControlRequest {
- // Whether the setting should be set to an enabled or disabled state.
- bool enabled = 1;
- }
|