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/type/class_reference.proto"; 20import "google/api/field_behavior.proto"; 21 22option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2/interactionmodel;interactionmodel"; 23option java_multiple_files = true; 24option java_outer_classname = "IntentProto"; 25option java_package = "com.google.actions.sdk.v2.interactionmodel"; 26 27// Intents map open-ended user input to structured objects. Spoken 28// phrases are matched to intents with Google's Natural Language Understanding 29// (NLU). Intent matches can trigger events in your conversation design to 30// progress the user's conversation. 31// The intent name is specified in the name of the file. 32message Intent { 33 // Definition of a parameter which can be used inside training phrases. 34 message IntentParameter { 35 // Entity set references for an intent parameter. 36 message EntitySetReferences { 37 // A reference to the set of allowed entities for this intent parameter. 38 message EntitySetReference { 39 // Required. Identifies the specific collection of entities to be considered for a 40 // given parameter. The corresponding entity set definition should be 41 // present in the custom/entitySets/ directory. 42 string entity_set = 1 [(google.api.field_behavior) = REQUIRED]; 43 } 44 45 // Required. Entity set references for an intent parameter. 46 repeated EntitySetReference entity_set_references = 1 [(google.api.field_behavior) = REQUIRED]; 47 } 48 49 // Required. Unique name of the intent parameter. Can be used in conditions and 50 // responses to reference intent parameters extracted by NLU with 51 // $intent.params.[name].resolved 52 string name = 1 [(google.api.field_behavior) = REQUIRED]; 53 54 // The type of the intent parameter. 55 oneof parameter_type { 56 // Optional. Declares the data type of this parameter. 57 // This should not be set for built-in intents. 58 google.actions.sdk.v2.interactionmodel.type.ClassReference type = 2 [(google.api.field_behavior) = OPTIONAL]; 59 60 // Optional. References to the sets of allowed entities for this intent parameter. 61 // Only valid for parameters of a built-in intent. These 62 // references point to entity sets in the 'custom/entitySets' directory. 63 EntitySetReferences entity_set_references = 3 [(google.api.field_behavior) = OPTIONAL]; 64 } 65 } 66 67 // The list of parameters within the training phrases. All parameters must be 68 // defined here to be used in the training phrase. 69 repeated IntentParameter parameters = 1; 70 71 // Training phrases allow Google’s NLU to automatically match intents with 72 // user input. The more unique phrases that are provided, the better chance 73 // this intent will be matched. 74 // The following is the format of training phrase part which are annotated. 75 // Note that `auto` field is optional and the default behavior when `auto` is 76 // not specified is equivalent to `auto=false`. 77 // `($<paramName> '<sample text>' auto=<true or false>)` 78 // `auto = true` means the part was auto annotated by NLU. 79 // `auto = false` means the part was annotated by the user. This is the 80 // default when auto is not specified. 81 // Example: 82 // "Book a flight from ($source 'San Francisco' auto=false) to ($dest 83 // 'Vancouver')" 84 repeated string training_phrases = 2; 85} 86