intent.proto 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. // Copyright 2021 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.cloud.dialogflow.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/dialogflow/v2/audio_config.proto";
  21. import "google/cloud/dialogflow/v2/context.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/duration.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. import "google/protobuf/struct.proto";
  27. option cc_enable_arenas = true;
  28. option csharp_namespace = "Google.Cloud.Dialogflow.V2";
  29. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  30. option java_multiple_files = true;
  31. option java_outer_classname = "IntentProto";
  32. option java_package = "com.google.cloud.dialogflow.v2";
  33. option objc_class_prefix = "DF";
  34. // Service for managing [Intents][google.cloud.dialogflow.v2.Intent].
  35. service Intents {
  36. option (google.api.default_host) = "dialogflow.googleapis.com";
  37. option (google.api.oauth_scopes) =
  38. "https://www.googleapis.com/auth/cloud-platform,"
  39. "https://www.googleapis.com/auth/dialogflow";
  40. // Returns the list of all intents in the specified agent.
  41. rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) {
  42. option (google.api.http) = {
  43. get: "/v2/{parent=projects/*/agent}/intents"
  44. additional_bindings {
  45. get: "/v2/{parent=projects/*/locations/*/agent}/intents"
  46. }
  47. additional_bindings {
  48. get: "/v2/{parent=projects/*/agent/environments/*}/intents"
  49. }
  50. additional_bindings {
  51. get: "/v2/{parent=projects/*/locations/*/agent/environments/*}/intents"
  52. }
  53. };
  54. option (google.api.method_signature) = "parent";
  55. option (google.api.method_signature) = "parent,language_code";
  56. }
  57. // Retrieves the specified intent.
  58. rpc GetIntent(GetIntentRequest) returns (Intent) {
  59. option (google.api.http) = {
  60. get: "/v2/{name=projects/*/agent/intents/*}"
  61. additional_bindings {
  62. get: "/v2/{name=projects/*/locations/*/agent/intents/*}"
  63. }
  64. };
  65. option (google.api.method_signature) = "name";
  66. option (google.api.method_signature) = "name,language_code";
  67. }
  68. // Creates an intent in the specified agent.
  69. //
  70. // Note: You should always train an agent prior to sending it queries. See the
  71. // [training
  72. // documentation](https://cloud.google.com/dialogflow/es/docs/training).
  73. rpc CreateIntent(CreateIntentRequest) returns (Intent) {
  74. option (google.api.http) = {
  75. post: "/v2/{parent=projects/*/agent}/intents"
  76. body: "intent"
  77. additional_bindings {
  78. post: "/v2/{parent=projects/*/locations/*/agent}/intents"
  79. body: "intent"
  80. }
  81. };
  82. option (google.api.method_signature) = "parent,intent";
  83. option (google.api.method_signature) = "parent,intent,language_code";
  84. }
  85. // Updates the specified intent.
  86. //
  87. // Note: You should always train an agent prior to sending it queries. See the
  88. // [training
  89. // documentation](https://cloud.google.com/dialogflow/es/docs/training).
  90. rpc UpdateIntent(UpdateIntentRequest) returns (Intent) {
  91. option (google.api.http) = {
  92. patch: "/v2/{intent.name=projects/*/agent/intents/*}"
  93. body: "intent"
  94. additional_bindings {
  95. patch: "/v2/{intent.name=projects/*/locations/*/agent/intents/*}"
  96. body: "intent"
  97. }
  98. };
  99. option (google.api.method_signature) = "intent,language_code";
  100. option (google.api.method_signature) = "intent,language_code,update_mask";
  101. }
  102. // Deletes the specified intent and its direct or indirect followup intents.
  103. //
  104. // Note: You should always train an agent prior to sending it queries. See the
  105. // [training
  106. // documentation](https://cloud.google.com/dialogflow/es/docs/training).
  107. rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) {
  108. option (google.api.http) = {
  109. delete: "/v2/{name=projects/*/agent/intents/*}"
  110. additional_bindings {
  111. delete: "/v2/{name=projects/*/locations/*/agent/intents/*}"
  112. }
  113. };
  114. option (google.api.method_signature) = "name";
  115. }
  116. // Updates/Creates multiple intents in the specified agent.
  117. //
  118. //
  119. // Note: You should always train an agent prior to sending it queries. See the
  120. // [training
  121. // documentation](https://cloud.google.com/dialogflow/es/docs/training).
  122. rpc BatchUpdateIntents(BatchUpdateIntentsRequest) returns (google.longrunning.Operation) {
  123. option (google.api.http) = {
  124. post: "/v2/{parent=projects/*/agent}/intents:batchUpdate"
  125. body: "*"
  126. additional_bindings {
  127. post: "/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate"
  128. body: "*"
  129. }
  130. };
  131. option (google.api.method_signature) = "parent,intent_batch_uri";
  132. option (google.api.method_signature) = "parent,intent_batch_inline";
  133. option (google.longrunning.operation_info) = {
  134. response_type: "google.cloud.dialogflow.v2.BatchUpdateIntentsResponse"
  135. metadata_type: "google.protobuf.Struct"
  136. };
  137. }
  138. // Deletes intents in the specified agent.
  139. //
  140. //
  141. // Note: You should always train an agent prior to sending it queries. See the
  142. // [training
  143. // documentation](https://cloud.google.com/dialogflow/es/docs/training).
  144. rpc BatchDeleteIntents(BatchDeleteIntentsRequest) returns (google.longrunning.Operation) {
  145. option (google.api.http) = {
  146. post: "/v2/{parent=projects/*/agent}/intents:batchDelete"
  147. body: "*"
  148. additional_bindings {
  149. post: "/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete"
  150. body: "*"
  151. }
  152. };
  153. option (google.api.method_signature) = "parent,intents";
  154. option (google.longrunning.operation_info) = {
  155. response_type: "google.protobuf.Empty"
  156. metadata_type: "google.protobuf.Struct"
  157. };
  158. }
  159. }
  160. // An intent categorizes an end-user's intention for one conversation turn. For
  161. // each agent, you define many intents, where your combined intents can handle a
  162. // complete conversation. When an end-user writes or says something, referred to
  163. // as an end-user expression or end-user input, Dialogflow matches the end-user
  164. // input to the best intent in your agent. Matching an intent is also known as
  165. // intent classification.
  166. //
  167. // For more information, see the [intent
  168. // guide](https://cloud.google.com/dialogflow/docs/intents-overview).
  169. message Intent {
  170. option (google.api.resource) = {
  171. type: "dialogflow.googleapis.com/Intent"
  172. pattern: "projects/{project}/agent/intents/{intent}"
  173. pattern: "projects/{project}/locations/{location}/agent/intents/{intent}"
  174. };
  175. // Represents an example that the agent is trained on.
  176. message TrainingPhrase {
  177. // Represents a part of a training phrase.
  178. message Part {
  179. // Required. The text for this part.
  180. string text = 1;
  181. // Optional. The entity type name prefixed with `@`.
  182. // This field is required for annotated parts of the training phrase.
  183. string entity_type = 2 [(google.api.field_behavior) = OPTIONAL];
  184. // Optional. The parameter name for the value extracted from the
  185. // annotated part of the example.
  186. // This field is required for annotated parts of the training phrase.
  187. string alias = 3 [(google.api.field_behavior) = OPTIONAL];
  188. // Optional. Indicates whether the text was manually annotated.
  189. // This field is set to true when the Dialogflow Console is used to
  190. // manually annotate the part. When creating an annotated part with the
  191. // API, you must set this to true.
  192. bool user_defined = 4 [(google.api.field_behavior) = OPTIONAL];
  193. }
  194. // Represents different types of training phrases.
  195. enum Type {
  196. // Not specified. This value should never be used.
  197. TYPE_UNSPECIFIED = 0;
  198. // Examples do not contain @-prefixed entity type names, but example parts
  199. // can be annotated with entity types.
  200. EXAMPLE = 1;
  201. // Templates are not annotated with entity types, but they can contain
  202. // @-prefixed entity type names as substrings.
  203. // Template mode has been deprecated. Example mode is the only supported
  204. // way to create new training phrases. If you have existing training
  205. // phrases that you've created in template mode, those will continue to
  206. // work.
  207. TEMPLATE = 2 [deprecated = true];
  208. }
  209. // Output only. The unique identifier of this training phrase.
  210. string name = 1;
  211. // Required. The type of the training phrase.
  212. Type type = 2 [(google.api.field_behavior) = REQUIRED];
  213. // Required. The ordered list of training phrase parts.
  214. // The parts are concatenated in order to form the training phrase.
  215. //
  216. // Note: The API does not automatically annotate training phrases like the
  217. // Dialogflow Console does.
  218. //
  219. // Note: Do not forget to include whitespace at part boundaries,
  220. // so the training phrase is well formatted when the parts are concatenated.
  221. //
  222. // If the training phrase does not need to be annotated with parameters,
  223. // you just need a single part with only the [Part.text][google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text] field set.
  224. //
  225. // If you want to annotate the training phrase, you must create multiple
  226. // parts, where the fields of each part are populated in one of two ways:
  227. //
  228. // - `Part.text` is set to a part of the phrase that has no parameters.
  229. // - `Part.text` is set to a part of the phrase that you want to annotate,
  230. // and the `entity_type`, `alias`, and `user_defined` fields are all
  231. // set.
  232. repeated Part parts = 3 [(google.api.field_behavior) = REQUIRED];
  233. // Optional. Indicates how many times this example was added to
  234. // the intent. Each time a developer adds an existing sample by editing an
  235. // intent or training, this counter is increased.
  236. int32 times_added_count = 4 [(google.api.field_behavior) = OPTIONAL];
  237. }
  238. // Represents intent parameters.
  239. message Parameter {
  240. // The unique identifier of this parameter.
  241. string name = 1;
  242. // Required. The name of the parameter.
  243. string display_name = 2;
  244. // Optional. The definition of the parameter value. It can be:
  245. //
  246. // - a constant string,
  247. // - a parameter value defined as `$parameter_name`,
  248. // - an original parameter value defined as `$parameter_name.original`,
  249. // - a parameter value from some context defined as
  250. // `#context_name.parameter_name`.
  251. string value = 3 [(google.api.field_behavior) = OPTIONAL];
  252. // Optional. The default value to use when the `value` yields an empty
  253. // result.
  254. // Default values can be extracted from contexts by using the following
  255. // syntax: `#context_name.parameter_name`.
  256. string default_value = 4 [(google.api.field_behavior) = OPTIONAL];
  257. // Optional. The name of the entity type, prefixed with `@`, that
  258. // describes values of the parameter. If the parameter is
  259. // required, this must be provided.
  260. string entity_type_display_name = 5 [(google.api.field_behavior) = OPTIONAL];
  261. // Optional. Indicates whether the parameter is required. That is,
  262. // whether the intent cannot be completed without collecting the parameter
  263. // value.
  264. bool mandatory = 6 [(google.api.field_behavior) = OPTIONAL];
  265. // Optional. The collection of prompts that the agent can present to the
  266. // user in order to collect a value for the parameter.
  267. repeated string prompts = 7 [(google.api.field_behavior) = OPTIONAL];
  268. // Optional. Indicates whether the parameter represents a list of values.
  269. bool is_list = 8 [(google.api.field_behavior) = OPTIONAL];
  270. }
  271. // A rich response message.
  272. // Corresponds to the intent `Response` field in the Dialogflow console.
  273. // For more information, see
  274. // [Rich response
  275. // messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages).
  276. message Message {
  277. // The text response message.
  278. message Text {
  279. // Optional. The collection of the agent's responses.
  280. repeated string text = 1 [(google.api.field_behavior) = OPTIONAL];
  281. }
  282. // The image response message.
  283. message Image {
  284. // Optional. The public URI to an image file.
  285. string image_uri = 1 [(google.api.field_behavior) = OPTIONAL];
  286. // Optional. A text description of the image to be used for accessibility,
  287. // e.g., screen readers.
  288. string accessibility_text = 2 [(google.api.field_behavior) = OPTIONAL];
  289. }
  290. // The quick replies response message.
  291. message QuickReplies {
  292. // Optional. The title of the collection of quick replies.
  293. string title = 1 [(google.api.field_behavior) = OPTIONAL];
  294. // Optional. The collection of quick replies.
  295. repeated string quick_replies = 2 [(google.api.field_behavior) = OPTIONAL];
  296. }
  297. // The card response message.
  298. message Card {
  299. // Contains information about a button.
  300. message Button {
  301. // Optional. The text to show on the button.
  302. string text = 1 [(google.api.field_behavior) = OPTIONAL];
  303. // Optional. The text to send back to the Dialogflow API or a URI to
  304. // open.
  305. string postback = 2 [(google.api.field_behavior) = OPTIONAL];
  306. }
  307. // Optional. The title of the card.
  308. string title = 1 [(google.api.field_behavior) = OPTIONAL];
  309. // Optional. The subtitle of the card.
  310. string subtitle = 2 [(google.api.field_behavior) = OPTIONAL];
  311. // Optional. The public URI to an image file for the card.
  312. string image_uri = 3 [(google.api.field_behavior) = OPTIONAL];
  313. // Optional. The collection of card buttons.
  314. repeated Button buttons = 4 [(google.api.field_behavior) = OPTIONAL];
  315. }
  316. // The simple response message containing speech or text.
  317. message SimpleResponse {
  318. // One of text_to_speech or ssml must be provided. The plain text of the
  319. // speech output. Mutually exclusive with ssml.
  320. string text_to_speech = 1;
  321. // One of text_to_speech or ssml must be provided. Structured spoken
  322. // response to the user in the SSML format. Mutually exclusive with
  323. // text_to_speech.
  324. string ssml = 2;
  325. // Optional. The text to display.
  326. string display_text = 3 [(google.api.field_behavior) = OPTIONAL];
  327. }
  328. // The collection of simple response candidates.
  329. // This message in `QueryResult.fulfillment_messages` and
  330. // `WebhookResponse.fulfillment_messages` should contain only one
  331. // `SimpleResponse`.
  332. message SimpleResponses {
  333. // Required. The list of simple responses.
  334. repeated SimpleResponse simple_responses = 1 [(google.api.field_behavior) = REQUIRED];
  335. }
  336. // The basic card message. Useful for displaying information.
  337. message BasicCard {
  338. // The button object that appears at the bottom of a card.
  339. message Button {
  340. // Opens the given URI.
  341. message OpenUriAction {
  342. // Required. The HTTP or HTTPS scheme URI.
  343. string uri = 1;
  344. }
  345. // Required. The title of the button.
  346. string title = 1;
  347. // Required. Action to take when a user taps on the button.
  348. OpenUriAction open_uri_action = 2 [(google.api.field_behavior) = REQUIRED];
  349. }
  350. // Optional. The title of the card.
  351. string title = 1 [(google.api.field_behavior) = OPTIONAL];
  352. // Optional. The subtitle of the card.
  353. string subtitle = 2 [(google.api.field_behavior) = OPTIONAL];
  354. // Required, unless image is present. The body text of the card.
  355. string formatted_text = 3;
  356. // Optional. The image for the card.
  357. Image image = 4 [(google.api.field_behavior) = OPTIONAL];
  358. // Optional. The collection of card buttons.
  359. repeated Button buttons = 5 [(google.api.field_behavior) = OPTIONAL];
  360. }
  361. // The suggestion chip message that the user can tap to quickly post a reply
  362. // to the conversation.
  363. message Suggestion {
  364. // Required. The text shown the in the suggestion chip.
  365. string title = 1 [(google.api.field_behavior) = REQUIRED];
  366. }
  367. // The collection of suggestions.
  368. message Suggestions {
  369. // Required. The list of suggested replies.
  370. repeated Suggestion suggestions = 1 [(google.api.field_behavior) = REQUIRED];
  371. }
  372. // The suggestion chip message that allows the user to jump out to the app
  373. // or website associated with this agent.
  374. message LinkOutSuggestion {
  375. // Required. The name of the app or site this chip is linking to.
  376. string destination_name = 1 [(google.api.field_behavior) = REQUIRED];
  377. // Required. The URI of the app or site to open when the user taps the
  378. // suggestion chip.
  379. string uri = 2 [(google.api.field_behavior) = REQUIRED];
  380. }
  381. // The card for presenting a list of options to select from.
  382. message ListSelect {
  383. // An item in the list.
  384. message Item {
  385. // Required. Additional information about this option.
  386. SelectItemInfo info = 1 [(google.api.field_behavior) = REQUIRED];
  387. // Required. The title of the list item.
  388. string title = 2 [(google.api.field_behavior) = REQUIRED];
  389. // Optional. The main text describing the item.
  390. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  391. // Optional. The image to display.
  392. Image image = 4 [(google.api.field_behavior) = OPTIONAL];
  393. }
  394. // Optional. The overall title of the list.
  395. string title = 1 [(google.api.field_behavior) = OPTIONAL];
  396. // Required. List items.
  397. repeated Item items = 2 [(google.api.field_behavior) = REQUIRED];
  398. // Optional. Subtitle of the list.
  399. string subtitle = 3 [(google.api.field_behavior) = OPTIONAL];
  400. }
  401. // The card for presenting a carousel of options to select from.
  402. message CarouselSelect {
  403. // An item in the carousel.
  404. message Item {
  405. // Required. Additional info about the option item.
  406. SelectItemInfo info = 1 [(google.api.field_behavior) = REQUIRED];
  407. // Required. Title of the carousel item.
  408. string title = 2 [(google.api.field_behavior) = REQUIRED];
  409. // Optional. The body text of the card.
  410. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  411. // Optional. The image to display.
  412. Image image = 4 [(google.api.field_behavior) = OPTIONAL];
  413. }
  414. // Required. Carousel items.
  415. repeated Item items = 1 [(google.api.field_behavior) = REQUIRED];
  416. }
  417. // Additional info about the select item for when it is triggered in a
  418. // dialog.
  419. message SelectItemInfo {
  420. // Required. A unique key that will be sent back to the agent if this
  421. // response is given.
  422. string key = 1 [(google.api.field_behavior) = REQUIRED];
  423. // Optional. A list of synonyms that can also be used to trigger this
  424. // item in dialog.
  425. repeated string synonyms = 2 [(google.api.field_behavior) = OPTIONAL];
  426. }
  427. // The media content card for Actions on Google.
  428. message MediaContent {
  429. // Response media object for media content card.
  430. message ResponseMediaObject {
  431. // Required. Name of media card.
  432. string name = 1;
  433. // Optional. Description of media card.
  434. string description = 2 [(google.api.field_behavior) = OPTIONAL];
  435. // Image to show with the media card.
  436. oneof image {
  437. // Optional. Image to display above media content.
  438. Image large_image = 3 [(google.api.field_behavior) = OPTIONAL];
  439. // Optional. Icon to display above media content.
  440. Image icon = 4 [(google.api.field_behavior) = OPTIONAL];
  441. }
  442. // Required. Url where the media is stored.
  443. string content_url = 5;
  444. }
  445. // Format of response media type.
  446. enum ResponseMediaType {
  447. // Unspecified.
  448. RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0;
  449. // Response media type is audio.
  450. AUDIO = 1;
  451. }
  452. // Optional. What type of media is the content (ie "audio").
  453. ResponseMediaType media_type = 1 [(google.api.field_behavior) = OPTIONAL];
  454. // Required. List of media objects.
  455. repeated ResponseMediaObject media_objects = 2;
  456. }
  457. // Browse Carousel Card for Actions on Google.
  458. // https://developers.google.com/actions/assistant/responses#browsing_carousel
  459. message BrowseCarouselCard {
  460. // Browsing carousel tile
  461. message BrowseCarouselCardItem {
  462. // Actions on Google action to open a given url.
  463. message OpenUrlAction {
  464. // Type of the URI.
  465. enum UrlTypeHint {
  466. // Unspecified
  467. URL_TYPE_HINT_UNSPECIFIED = 0;
  468. // Url would be an amp action
  469. AMP_ACTION = 1;
  470. // URL that points directly to AMP content, or to a canonical URL
  471. // which refers to AMP content via <link rel="amphtml">.
  472. AMP_CONTENT = 2;
  473. }
  474. // Required. URL
  475. string url = 1;
  476. // Optional. Specifies the type of viewer that is used when opening
  477. // the URL. Defaults to opening via web browser.
  478. UrlTypeHint url_type_hint = 3 [(google.api.field_behavior) = OPTIONAL];
  479. }
  480. // Required. Action to present to the user.
  481. OpenUrlAction open_uri_action = 1;
  482. // Required. Title of the carousel item. Maximum of two lines of text.
  483. string title = 2;
  484. // Optional. Description of the carousel item. Maximum of four lines of
  485. // text.
  486. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  487. // Optional. Hero image for the carousel item.
  488. Image image = 4 [(google.api.field_behavior) = OPTIONAL];
  489. // Optional. Text that appears at the bottom of the Browse Carousel
  490. // Card. Maximum of one line of text.
  491. string footer = 5 [(google.api.field_behavior) = OPTIONAL];
  492. }
  493. // Image display options for Actions on Google. This should be used for
  494. // when the image's aspect ratio does not match the image container's
  495. // aspect ratio.
  496. enum ImageDisplayOptions {
  497. // Fill the gaps between the image and the image container with gray
  498. // bars.
  499. IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0;
  500. // Fill the gaps between the image and the image container with gray
  501. // bars.
  502. GRAY = 1;
  503. // Fill the gaps between the image and the image container with white
  504. // bars.
  505. WHITE = 2;
  506. // Image is scaled such that the image width and height match or exceed
  507. // the container dimensions. This may crop the top and bottom of the
  508. // image if the scaled image height is greater than the container
  509. // height, or crop the left and right of the image if the scaled image
  510. // width is greater than the container width. This is similar to "Zoom
  511. // Mode" on a widescreen TV when playing a 4:3 video.
  512. CROPPED = 3;
  513. // Pad the gaps between image and image frame with a blurred copy of the
  514. // same image.
  515. BLURRED_BACKGROUND = 4;
  516. }
  517. // Required. List of items in the Browse Carousel Card. Minimum of two
  518. // items, maximum of ten.
  519. repeated BrowseCarouselCardItem items = 1;
  520. // Optional. Settings for displaying the image. Applies to every image in
  521. // [items][google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items].
  522. ImageDisplayOptions image_display_options = 2 [(google.api.field_behavior) = OPTIONAL];
  523. }
  524. // Table card for Actions on Google.
  525. message TableCard {
  526. // Required. Title of the card.
  527. string title = 1;
  528. // Optional. Subtitle to the title.
  529. string subtitle = 2 [(google.api.field_behavior) = OPTIONAL];
  530. // Optional. Image which should be displayed on the card.
  531. Image image = 3 [(google.api.field_behavior) = OPTIONAL];
  532. // Optional. Display properties for the columns in this table.
  533. repeated ColumnProperties column_properties = 4 [(google.api.field_behavior) = OPTIONAL];
  534. // Optional. Rows in this table of data.
  535. repeated TableCardRow rows = 5 [(google.api.field_behavior) = OPTIONAL];
  536. // Optional. List of buttons for the card.
  537. repeated BasicCard.Button buttons = 6 [(google.api.field_behavior) = OPTIONAL];
  538. }
  539. // Column properties for [TableCard][google.cloud.dialogflow.v2.Intent.Message.TableCard].
  540. message ColumnProperties {
  541. // Text alignments within a cell.
  542. enum HorizontalAlignment {
  543. // Text is aligned to the leading edge of the column.
  544. HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0;
  545. // Text is aligned to the leading edge of the column.
  546. LEADING = 1;
  547. // Text is centered in the column.
  548. CENTER = 2;
  549. // Text is aligned to the trailing edge of the column.
  550. TRAILING = 3;
  551. }
  552. // Required. Column heading.
  553. string header = 1;
  554. // Optional. Defines text alignment for all cells in this column.
  555. HorizontalAlignment horizontal_alignment = 2 [(google.api.field_behavior) = OPTIONAL];
  556. }
  557. // Row of [TableCard][google.cloud.dialogflow.v2.Intent.Message.TableCard].
  558. message TableCardRow {
  559. // Optional. List of cells that make up this row.
  560. repeated TableCardCell cells = 1 [(google.api.field_behavior) = OPTIONAL];
  561. // Optional. Whether to add a visual divider after this row.
  562. bool divider_after = 2 [(google.api.field_behavior) = OPTIONAL];
  563. }
  564. // Cell of [TableCardRow][google.cloud.dialogflow.v2.Intent.Message.TableCardRow].
  565. message TableCardCell {
  566. // Required. Text in this cell.
  567. string text = 1;
  568. }
  569. // The rich response message integration platform. See
  570. // [Integrations](https://cloud.google.com/dialogflow/docs/integrations).
  571. enum Platform {
  572. // Default platform.
  573. PLATFORM_UNSPECIFIED = 0;
  574. // Facebook.
  575. FACEBOOK = 1;
  576. // Slack.
  577. SLACK = 2;
  578. // Telegram.
  579. TELEGRAM = 3;
  580. // Kik.
  581. KIK = 4;
  582. // Skype.
  583. SKYPE = 5;
  584. // Line.
  585. LINE = 6;
  586. // Viber.
  587. VIBER = 7;
  588. // Google Assistant
  589. // See [Dialogflow webhook
  590. // format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json)
  591. ACTIONS_ON_GOOGLE = 8;
  592. // Google Hangouts.
  593. GOOGLE_HANGOUTS = 11;
  594. }
  595. // Required. The rich response message.
  596. oneof message {
  597. // The text response.
  598. Text text = 1;
  599. // The image response.
  600. Image image = 2;
  601. // The quick replies response.
  602. QuickReplies quick_replies = 3;
  603. // The card response.
  604. Card card = 4;
  605. // A custom platform-specific response.
  606. google.protobuf.Struct payload = 5;
  607. // The voice and text-only responses for Actions on Google.
  608. SimpleResponses simple_responses = 7;
  609. // The basic card response for Actions on Google.
  610. BasicCard basic_card = 8;
  611. // The suggestion chips for Actions on Google.
  612. Suggestions suggestions = 9;
  613. // The link out suggestion chip for Actions on Google.
  614. LinkOutSuggestion link_out_suggestion = 10;
  615. // The list card response for Actions on Google.
  616. ListSelect list_select = 11;
  617. // The carousel card response for Actions on Google.
  618. CarouselSelect carousel_select = 12;
  619. // Browse carousel card for Actions on Google.
  620. BrowseCarouselCard browse_carousel_card = 22;
  621. // Table card for Actions on Google.
  622. TableCard table_card = 23;
  623. // The media content card for Actions on Google.
  624. MediaContent media_content = 24;
  625. }
  626. // Optional. The platform that this message is intended for.
  627. Platform platform = 6 [(google.api.field_behavior) = OPTIONAL];
  628. }
  629. // Represents a single followup intent in the chain.
  630. message FollowupIntentInfo {
  631. // The unique identifier of the followup intent.
  632. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  633. string followup_intent_name = 1;
  634. // The unique identifier of the followup intent's parent.
  635. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  636. string parent_followup_intent_name = 2;
  637. }
  638. // Represents the different states that webhooks can be in.
  639. enum WebhookState {
  640. // Webhook is disabled in the agent and in the intent.
  641. WEBHOOK_STATE_UNSPECIFIED = 0;
  642. // Webhook is enabled in the agent and in the intent.
  643. WEBHOOK_STATE_ENABLED = 1;
  644. // Webhook is enabled in the agent and in the intent. Also, each slot
  645. // filling prompt is forwarded to the webhook.
  646. WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2;
  647. }
  648. // Optional. The unique identifier of this intent.
  649. // Required for [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent] and [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents]
  650. // methods.
  651. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  652. string name = 1 [(google.api.field_behavior) = OPTIONAL];
  653. // Required. The name of this intent.
  654. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  655. // Optional. Indicates whether webhooks are enabled for the intent.
  656. WebhookState webhook_state = 6 [(google.api.field_behavior) = OPTIONAL];
  657. // Optional. The priority of this intent. Higher numbers represent higher
  658. // priorities.
  659. //
  660. // - If the supplied value is unspecified or 0, the service
  661. // translates the value to 500,000, which corresponds to the
  662. // `Normal` priority in the console.
  663. // - If the supplied value is negative, the intent is ignored
  664. // in runtime detect intent requests.
  665. int32 priority = 3 [(google.api.field_behavior) = OPTIONAL];
  666. // Optional. Indicates whether this is a fallback intent.
  667. bool is_fallback = 4 [(google.api.field_behavior) = OPTIONAL];
  668. // Optional. Indicates whether Machine Learning is disabled for the intent.
  669. // Note: If `ml_disabled` setting is set to true, then this intent is not
  670. // taken into account during inference in `ML ONLY` match mode. Also,
  671. // auto-markup in the UI is turned off.
  672. bool ml_disabled = 19 [(google.api.field_behavior) = OPTIONAL];
  673. // Optional. Indicates that a live agent should be brought in to handle the
  674. // interaction with the user. In most cases, when you set this flag to true,
  675. // you would also want to set end_interaction to true as well. Default is
  676. // false.
  677. bool live_agent_handoff = 20 [(google.api.field_behavior) = OPTIONAL];
  678. // Optional. Indicates that this intent ends an interaction. Some integrations
  679. // (e.g., Actions on Google or Dialogflow phone gateway) use this information
  680. // to close interaction with an end user. Default is false.
  681. bool end_interaction = 21 [(google.api.field_behavior) = OPTIONAL];
  682. // Optional. The list of context names required for this intent to be
  683. // triggered.
  684. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
  685. repeated string input_context_names = 7 [(google.api.field_behavior) = OPTIONAL];
  686. // Optional. The collection of event names that trigger the intent.
  687. // If the collection of input contexts is not empty, all of the contexts must
  688. // be present in the active user session for an event to trigger this intent.
  689. // Event names are limited to 150 characters.
  690. repeated string events = 8 [(google.api.field_behavior) = OPTIONAL];
  691. // Optional. The collection of examples that the agent is
  692. // trained on.
  693. repeated TrainingPhrase training_phrases = 9 [(google.api.field_behavior) = OPTIONAL];
  694. // Optional. The name of the action associated with the intent.
  695. // Note: The action name must not contain whitespaces.
  696. string action = 10 [(google.api.field_behavior) = OPTIONAL];
  697. // Optional. The collection of contexts that are activated when the intent
  698. // is matched. Context messages in this collection should not set the
  699. // parameters field. Setting the `lifespan_count` to 0 will reset the context
  700. // when the intent is matched.
  701. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context ID>`.
  702. repeated Context output_contexts = 11 [(google.api.field_behavior) = OPTIONAL];
  703. // Optional. Indicates whether to delete all contexts in the current
  704. // session when this intent is matched.
  705. bool reset_contexts = 12 [(google.api.field_behavior) = OPTIONAL];
  706. // Optional. The collection of parameters associated with the intent.
  707. repeated Parameter parameters = 13 [(google.api.field_behavior) = OPTIONAL];
  708. // Optional. The collection of rich messages corresponding to the
  709. // `Response` field in the Dialogflow console.
  710. repeated Message messages = 14 [(google.api.field_behavior) = OPTIONAL];
  711. // Optional. The list of platforms for which the first responses will be
  712. // copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform).
  713. repeated Message.Platform default_response_platforms = 15 [(google.api.field_behavior) = OPTIONAL];
  714. // Read-only. The unique identifier of the root intent in the chain of
  715. // followup intents. It identifies the correct followup intents chain for
  716. // this intent. We populate this field only in the output.
  717. //
  718. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  719. string root_followup_intent_name = 16;
  720. // Read-only after creation. The unique identifier of the parent intent in the
  721. // chain of followup intents. You can set this field when creating an intent,
  722. // for example with [CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent] or
  723. // [BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents], in order to make this
  724. // intent a followup intent.
  725. //
  726. // It identifies the parent followup intent.
  727. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  728. string parent_followup_intent_name = 17;
  729. // Read-only. Information about all followup intents that have this intent as
  730. // a direct or indirect parent. We populate this field only in the output.
  731. repeated FollowupIntentInfo followup_intent_info = 18;
  732. }
  733. // The request message for [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents].
  734. message ListIntentsRequest {
  735. // Required. The agent to list all intents from.
  736. // Format: `projects/<Project ID>/agent` or `projects/<Project
  737. // ID>/locations/<Location ID>/agent`.
  738. //
  739. // Alternatively, you can specify the environment to list intents for.
  740. // Format: `projects/<Project ID>/agent/environments/<Environment ID>`
  741. // or `projects/<Project ID>/locations/<Location
  742. // ID>/agent/environments/<Environment ID>`.
  743. // Note: training phrases of the intents will not be returned for non-draft
  744. // environment.
  745. string parent = 1 [
  746. (google.api.field_behavior) = REQUIRED,
  747. (google.api.resource_reference) = {
  748. child_type: "dialogflow.googleapis.com/Intent"
  749. }
  750. ];
  751. // Optional. The language used to access language-specific data.
  752. // If not specified, the agent's default language is used.
  753. // For more information, see
  754. // [Multilingual intent and entity
  755. // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
  756. string language_code = 2 [(google.api.field_behavior) = OPTIONAL];
  757. // Optional. The resource view to apply to the returned intent.
  758. IntentView intent_view = 3 [(google.api.field_behavior) = OPTIONAL];
  759. // Optional. The maximum number of items to return in a single page. By
  760. // default 100 and at most 1000.
  761. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
  762. // Optional. The next_page_token value returned from a previous list request.
  763. string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
  764. }
  765. // The response message for [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents].
  766. message ListIntentsResponse {
  767. // The list of agent intents. There will be a maximum number of items
  768. // returned based on the page_size field in the request.
  769. repeated Intent intents = 1;
  770. // Token to retrieve the next page of results, or empty if there are no
  771. // more results in the list.
  772. string next_page_token = 2;
  773. }
  774. // The request message for [Intents.GetIntent][google.cloud.dialogflow.v2.Intents.GetIntent].
  775. message GetIntentRequest {
  776. // Required. The name of the intent.
  777. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  778. string name = 1 [
  779. (google.api.field_behavior) = REQUIRED,
  780. (google.api.resource_reference) = {
  781. type: "dialogflow.googleapis.com/Intent"
  782. }
  783. ];
  784. // Optional. The language used to access language-specific data.
  785. // If not specified, the agent's default language is used.
  786. // For more information, see
  787. // [Multilingual intent and entity
  788. // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
  789. string language_code = 2 [(google.api.field_behavior) = OPTIONAL];
  790. // Optional. The resource view to apply to the returned intent.
  791. IntentView intent_view = 3 [(google.api.field_behavior) = OPTIONAL];
  792. }
  793. // The request message for [Intents.CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent].
  794. message CreateIntentRequest {
  795. // Required. The agent to create a intent for.
  796. // Format: `projects/<Project ID>/agent`.
  797. string parent = 1 [
  798. (google.api.field_behavior) = REQUIRED,
  799. (google.api.resource_reference) = {
  800. child_type: "dialogflow.googleapis.com/Intent"
  801. }
  802. ];
  803. // Required. The intent to create.
  804. Intent intent = 2 [(google.api.field_behavior) = REQUIRED];
  805. // Optional. The language used to access language-specific data.
  806. // If not specified, the agent's default language is used.
  807. // For more information, see
  808. // [Multilingual intent and entity
  809. // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
  810. string language_code = 3 [(google.api.field_behavior) = OPTIONAL];
  811. // Optional. The resource view to apply to the returned intent.
  812. IntentView intent_view = 4 [(google.api.field_behavior) = OPTIONAL];
  813. }
  814. // The request message for [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent].
  815. message UpdateIntentRequest {
  816. // Required. The intent to update.
  817. Intent intent = 1 [(google.api.field_behavior) = REQUIRED];
  818. // Optional. The language used to access language-specific data.
  819. // If not specified, the agent's default language is used.
  820. // For more information, see
  821. // [Multilingual intent and entity
  822. // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
  823. string language_code = 2 [(google.api.field_behavior) = OPTIONAL];
  824. // Optional. The mask to control which fields get updated.
  825. google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL];
  826. // Optional. The resource view to apply to the returned intent.
  827. IntentView intent_view = 4 [(google.api.field_behavior) = OPTIONAL];
  828. }
  829. // The request message for [Intents.DeleteIntent][google.cloud.dialogflow.v2.Intents.DeleteIntent].
  830. message DeleteIntentRequest {
  831. // Required. The name of the intent to delete. If this intent has direct or
  832. // indirect followup intents, we also delete them.
  833. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  834. string name = 1 [
  835. (google.api.field_behavior) = REQUIRED,
  836. (google.api.resource_reference) = {
  837. type: "dialogflow.googleapis.com/Intent"
  838. }
  839. ];
  840. }
  841. message BatchUpdateIntentsRequest {
  842. // Required. The name of the agent to update or create intents in.
  843. // Format: `projects/<Project ID>/agent`.
  844. string parent = 1 [
  845. (google.api.field_behavior) = REQUIRED,
  846. (google.api.resource_reference) = {
  847. child_type: "dialogflow.googleapis.com/Intent"
  848. }
  849. ];
  850. // The source of the intent batch.
  851. oneof intent_batch {
  852. // The URI to a Google Cloud Storage file containing intents to update or
  853. // create. The file format can either be a serialized proto (of IntentBatch
  854. // type) or JSON object. Note: The URI must start with "gs://".
  855. string intent_batch_uri = 2;
  856. // The collection of intents to update or create.
  857. IntentBatch intent_batch_inline = 3;
  858. }
  859. // Optional. The language used to access language-specific data.
  860. // If not specified, the agent's default language is used.
  861. // For more information, see
  862. // [Multilingual intent and entity
  863. // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
  864. string language_code = 4 [(google.api.field_behavior) = OPTIONAL];
  865. // Optional. The mask to control which fields get updated.
  866. google.protobuf.FieldMask update_mask = 5 [(google.api.field_behavior) = OPTIONAL];
  867. // Optional. The resource view to apply to the returned intent.
  868. IntentView intent_view = 6 [(google.api.field_behavior) = OPTIONAL];
  869. }
  870. // The response message for [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents].
  871. message BatchUpdateIntentsResponse {
  872. // The collection of updated or created intents.
  873. repeated Intent intents = 1;
  874. }
  875. // The request message for [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2.Intents.BatchDeleteIntents].
  876. message BatchDeleteIntentsRequest {
  877. // Required. The name of the agent to delete all entities types for. Format:
  878. // `projects/<Project ID>/agent`.
  879. string parent = 1 [
  880. (google.api.field_behavior) = REQUIRED,
  881. (google.api.resource_reference) = {
  882. child_type: "dialogflow.googleapis.com/Intent"
  883. }
  884. ];
  885. // Required. The collection of intents to delete. Only intent `name` must be
  886. // filled in.
  887. repeated Intent intents = 2 [(google.api.field_behavior) = REQUIRED];
  888. }
  889. // This message is a wrapper around a collection of intents.
  890. message IntentBatch {
  891. // A collection of intents.
  892. repeated Intent intents = 1;
  893. }
  894. // Represents the options for views of an intent.
  895. // An intent can be a sizable object. Therefore, we provide a resource view that
  896. // does not return training phrases in the response by default.
  897. enum IntentView {
  898. // Training phrases field is not populated in the response.
  899. INTENT_VIEW_UNSPECIFIED = 0;
  900. // All fields are populated.
  901. INTENT_VIEW_FULL = 1;
  902. }