intent.proto 3.9 KB

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