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