intent.proto 43 KB

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