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.v2beta1; 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/v2beta1/conversation_profile.proto"; 24import "google/cloud/dialogflow/v2beta1/participant.proto"; 25import "google/cloud/dialogflow/v2beta1/session.proto"; 26import "google/protobuf/timestamp.proto"; 27 28option cc_enable_arenas = true; 29option csharp_namespace = "Google.Cloud.Dialogflow.V2Beta1"; 30option go_package = "cloud.google.com/go/dialogflow/apiv2beta1/dialogflowpb;dialogflowpb"; 31option java_multiple_files = true; 32option java_outer_classname = "ConversationProto"; 33option java_package = "com.google.cloud.dialogflow.v2beta1"; 34option objc_class_prefix = "DF"; 35 36// Service for managing 37// [Conversations][google.cloud.dialogflow.v2beta1.Conversation]. 38service Conversations { 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 // Creates a new conversation. Conversations are auto-completed after 24 45 // hours. 46 // 47 // Conversation Lifecycle: 48 // There are two stages during a conversation: Automated Agent Stage and 49 // Assist Stage. 50 // 51 // For Automated Agent Stage, there will be a dialogflow agent responding to 52 // user queries. 53 // 54 // For Assist Stage, there's no dialogflow agent responding to user queries. 55 // But we will provide suggestions which are generated from conversation. 56 // 57 // If 58 // [Conversation.conversation_profile][google.cloud.dialogflow.v2beta1.Conversation.conversation_profile] 59 // is configured for a dialogflow agent, conversation will start from 60 // `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And 61 // during `Automated Agent Stage`, once an 62 // [Intent][google.cloud.dialogflow.v2beta1.Intent] with 63 // [Intent.live_agent_handoff][google.cloud.dialogflow.v2beta1.Intent.live_agent_handoff] 64 // is triggered, conversation will transfer to Assist Stage. 65 rpc CreateConversation(CreateConversationRequest) returns (Conversation) { 66 option (google.api.http) = { 67 post: "/v2beta1/{parent=projects/*}/conversations" 68 body: "conversation" 69 additional_bindings { 70 post: "/v2beta1/{parent=projects/*/locations/*}/conversations" 71 body: "conversation" 72 } 73 }; 74 option (google.api.method_signature) = "parent,conversation"; 75 } 76 77 // Returns the list of all conversations in the specified project. 78 rpc ListConversations(ListConversationsRequest) 79 returns (ListConversationsResponse) { 80 option (google.api.http) = { 81 get: "/v2beta1/{parent=projects/*}/conversations" 82 additional_bindings { 83 get: "/v2beta1/{parent=projects/*/locations/*}/conversations" 84 } 85 }; 86 option (google.api.method_signature) = "parent"; 87 } 88 89 // Retrieves the specific conversation. 90 rpc GetConversation(GetConversationRequest) returns (Conversation) { 91 option (google.api.http) = { 92 get: "/v2beta1/{name=projects/*/conversations/*}" 93 additional_bindings { 94 get: "/v2beta1/{name=projects/*/locations/*/conversations/*}" 95 } 96 }; 97 option (google.api.method_signature) = "name"; 98 } 99 100 // Completes the specified conversation. Finished conversations are purged 101 // from the database after 30 days. 102 rpc CompleteConversation(CompleteConversationRequest) returns (Conversation) { 103 option (google.api.http) = { 104 post: "/v2beta1/{name=projects/*/conversations/*}:complete" 105 body: "*" 106 additional_bindings { 107 post: "/v2beta1/{name=projects/*/locations/*/conversations/*}:complete" 108 body: "*" 109 } 110 }; 111 option (google.api.method_signature) = "name"; 112 } 113 114 // Batch ingests messages to conversation. Customers can use this RPC to 115 // ingest historical messages to conversation. 116 rpc BatchCreateMessages(BatchCreateMessagesRequest) 117 returns (BatchCreateMessagesResponse) { 118 option (google.api.http) = { 119 post: "/v2beta1/{parent=projects/*/conversations/*}/messages:batchCreate" 120 body: "*" 121 additional_bindings { 122 post: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages:batchCreate" 123 body: "*" 124 } 125 }; 126 option (google.api.method_signature) = "parent"; 127 } 128 129 // Lists messages that belong to a given conversation. 130 // `messages` are ordered by `create_time` in descending order. To fetch 131 // updates without duplication, send request with filter 132 // `create_time_epoch_microseconds > 133 // [first item's create_time of previous request]` and empty page_token. 134 rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { 135 option (google.api.http) = { 136 get: "/v2beta1/{parent=projects/*/conversations/*}/messages" 137 additional_bindings { 138 get: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages" 139 } 140 }; 141 option (google.api.method_signature) = "parent"; 142 } 143 144 // Suggest summary for a conversation based on specific historical messages. 145 // The range of the messages to be used for summary can be specified in the 146 // request. 147 rpc SuggestConversationSummary(SuggestConversationSummaryRequest) 148 returns (SuggestConversationSummaryResponse) { 149 option (google.api.http) = { 150 post: "/v2beta1/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary" 151 body: "*" 152 additional_bindings { 153 post: "/v2beta1/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary" 154 body: "*" 155 } 156 }; 157 option (google.api.method_signature) = "conversation"; 158 } 159 160 // Generates and returns a summary for a conversation that does not have a 161 // resource created for it. 162 rpc GenerateStatelessSummary(GenerateStatelessSummaryRequest) 163 returns (GenerateStatelessSummaryResponse) { 164 option (google.api.http) = { 165 post: "/v2beta1/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary" 166 body: "*" 167 additional_bindings { 168 post: "/v2beta1/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary" 169 body: "*" 170 } 171 }; 172 } 173 174 // Get answers for the given query based on knowledge documents. 175 rpc SearchKnowledge(SearchKnowledgeRequest) 176 returns (SearchKnowledgeResponse) { 177 option (google.api.http) = { 178 post: "/v2beta1/{parent=projects/*}/suggestions:searchKnowledge" 179 body: "*" 180 additional_bindings { 181 post: "/v2beta1/{parent=projects/*/locations/*}/suggestions:searchKnowledge" 182 body: "*" 183 } 184 additional_bindings { 185 post: "/v2beta1/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge" 186 body: "*" 187 } 188 additional_bindings { 189 post: "/v2beta1/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge" 190 body: "*" 191 } 192 }; 193 } 194} 195 196// Represents a conversation. 197// A conversation is an interaction between an agent, including live agents 198// and Dialogflow agents, and a support customer. Conversations can 199// include phone calls and text-based chat sessions. 200message Conversation { 201 option (google.api.resource) = { 202 type: "dialogflow.googleapis.com/Conversation" 203 pattern: "projects/{project}/conversations/{conversation}" 204 pattern: "projects/{project}/locations/{location}/conversations/{conversation}" 205 }; 206 207 // Enumeration of the completion status of the conversation. 208 enum LifecycleState { 209 // Unknown. 210 LIFECYCLE_STATE_UNSPECIFIED = 0; 211 212 // Conversation is currently open for media analysis. 213 IN_PROGRESS = 1; 214 215 // Conversation has been completed. 216 COMPLETED = 2; 217 } 218 219 // Enumeration of the different conversation stages a conversation can be in. 220 // Reference: 221 // https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages 222 enum ConversationStage { 223 // Unknown. Should never be used after a conversation is successfully 224 // created. 225 CONVERSATION_STAGE_UNSPECIFIED = 0; 226 227 // The conversation should return virtual agent responses into the 228 // conversation. 229 VIRTUAL_AGENT_STAGE = 1; 230 231 // The conversation should not provide responses, just listen and provide 232 // suggestions. 233 HUMAN_ASSIST_STAGE = 2; 234 } 235 236 // Output only. The unique identifier of this conversation. 237 // Format: `projects/<Project ID>/locations/<Location 238 // ID>/conversations/<Conversation ID>`. 239 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 240 241 // Output only. The current state of the Conversation. 242 LifecycleState lifecycle_state = 2 243 [(google.api.field_behavior) = OUTPUT_ONLY]; 244 245 // Required. The Conversation Profile to be used to configure this 246 // Conversation. This field cannot be updated. 247 // Format: `projects/<Project ID>/locations/<Location 248 // ID>/conversationProfiles/<Conversation Profile ID>`. 249 string conversation_profile = 3 [ 250 (google.api.field_behavior) = REQUIRED, 251 (google.api.resource_reference) = { 252 type: "dialogflow.googleapis.com/ConversationProfile" 253 } 254 ]; 255 256 // Output only. Required if the conversation is to be connected over 257 // telephony. 258 ConversationPhoneNumber phone_number = 4 259 [(google.api.field_behavior) = OUTPUT_ONLY]; 260 261 // The stage of a conversation. It indicates whether the virtual agent or a 262 // human agent is handling the conversation. 263 // 264 // If the conversation is created with the conversation profile that has 265 // Dialogflow config set, defaults to 266 // [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; 267 // Otherwise, defaults to 268 // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. 269 // 270 // If the conversation is created with the conversation profile that has 271 // Dialogflow config set but explicitly sets conversation_stage to 272 // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], 273 // it skips 274 // [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] 275 // stage and directly goes to 276 // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. 277 ConversationStage conversation_stage = 7; 278 279 // Output only. The time the conversation was started. 280 google.protobuf.Timestamp start_time = 5 281 [(google.api.field_behavior) = OUTPUT_ONLY]; 282 283 // Output only. The time the conversation was finished. 284 google.protobuf.Timestamp end_time = 6 285 [(google.api.field_behavior) = OUTPUT_ONLY]; 286} 287 288// Represents a phone number for telephony integration. It allows for connecting 289// a particular conversation over telephony. 290message ConversationPhoneNumber { 291 // Output only. The phone number to connect to this conversation. 292 string phone_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 293} 294 295// The request message for 296// [Conversations.CreateConversation][google.cloud.dialogflow.v2beta1.Conversations.CreateConversation]. 297message CreateConversationRequest { 298 // Required. Resource identifier of the project creating the conversation. 299 // Format: `projects/<Project ID>/locations/<Location ID>`. 300 string parent = 1 [ 301 (google.api.field_behavior) = REQUIRED, 302 (google.api.resource_reference) = { 303 child_type: "dialogflow.googleapis.com/Conversation" 304 } 305 ]; 306 307 // Required. The conversation to create. 308 Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; 309 310 // Optional. Identifier of the conversation. Generally it's auto generated by 311 // Google. Only set it if you cannot wait for the response to return a 312 // auto-generated one to you. 313 // 314 // The conversation ID must be compliant with the regression fomula 315 // `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. 316 // If the field is provided, the caller is resposible for 317 // 1. the uniqueness of the ID, otherwise the request will be rejected. 318 // 2. the consistency for whether to use custom ID or not under a project to 319 // better ensure uniqueness. 320 string conversation_id = 3 [(google.api.field_behavior) = OPTIONAL]; 321} 322 323// The request message for 324// [Conversations.ListConversations][google.cloud.dialogflow.v2beta1.Conversations.ListConversations]. 325message ListConversationsRequest { 326 // Required. The project from which to list all conversation. 327 // Format: `projects/<Project ID>/locations/<Location ID>`. 328 string parent = 1 [ 329 (google.api.field_behavior) = REQUIRED, 330 (google.api.resource_reference) = { 331 child_type: "dialogflow.googleapis.com/Conversation" 332 } 333 ]; 334 335 // Optional. The maximum number of items to return in a single page. By 336 // default 100 and at most 1000. 337 int32 page_size = 2; 338 339 // Optional. The next_page_token value returned from a previous list request. 340 string page_token = 3; 341 342 // A filter expression that filters conversations listed in the response. In 343 // general, the expression must specify the field name, a comparison operator, 344 // and the value to use for filtering: 345 // <ul> 346 // <li>The value must be a string, a number, or a boolean.</li> 347 // <li>The comparison operator must be either `=`,`!=`, `>`, or `<`.</li> 348 // <li>To filter on multiple expressions, separate the 349 // expressions with `AND` or `OR` (omitting both implies `AND`).</li> 350 // <li>For clarity, expressions can be enclosed in parentheses.</li> 351 // </ul> 352 // Only `lifecycle_state` can be filtered on in this way. For example, 353 // the following expression only returns `COMPLETED` conversations: 354 // 355 // `lifecycle_state = "COMPLETED"` 356 // 357 // For more information about filtering, see 358 // [API Filtering](https://aip.dev/160). 359 string filter = 4; 360} 361 362// The response message for 363// [Conversations.ListConversations][google.cloud.dialogflow.v2beta1.Conversations.ListConversations]. 364message ListConversationsResponse { 365 // The list of conversations. There will be a maximum number of items 366 // returned based on the page_size field in the request. 367 repeated Conversation conversations = 1; 368 369 // Token to retrieve the next page of results, or empty if there are no 370 // more results in the list. 371 string next_page_token = 2; 372} 373 374// The request message for 375// [Conversations.GetConversation][google.cloud.dialogflow.v2beta1.Conversations.GetConversation]. 376message GetConversationRequest { 377 // Required. The name of the conversation. Format: 378 // `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation 379 // ID>`. 380 string name = 1 [ 381 (google.api.field_behavior) = REQUIRED, 382 (google.api.resource_reference) = { 383 type: "dialogflow.googleapis.com/Conversation" 384 } 385 ]; 386} 387 388// The request message for 389// [Conversations.CompleteConversation][google.cloud.dialogflow.v2beta1.Conversations.CompleteConversation]. 390message CompleteConversationRequest { 391 // Required. Resource identifier of the conversation to close. 392 // Format: `projects/<Project ID>/locations/<Location 393 // ID>/conversations/<Conversation ID>`. 394 string name = 1 [ 395 (google.api.field_behavior) = REQUIRED, 396 (google.api.resource_reference) = { 397 type: "dialogflow.googleapis.com/Conversation" 398 } 399 ]; 400} 401 402// The request message to create one Message. Currently it is only used in 403// BatchCreateMessagesRequest. 404message CreateMessageRequest { 405 // Required. Resource identifier of the conversation to create message. 406 // Format: `projects/<Project ID>/locations/<Location 407 // ID>/conversations/<Conversation ID>`. 408 string parent = 1 [ 409 (google.api.field_behavior) = REQUIRED, 410 (google.api.resource_reference) = { 411 type: "dialogflow.googleapis.com/Conversation" 412 } 413 ]; 414 415 // Required. The message to create. 416 // [Message.participant][google.cloud.dialogflow.v2beta1.Message.participant] 417 // is required. 418 Message message = 2 [(google.api.field_behavior) = REQUIRED]; 419} 420 421// The request message for [Conversations.BatchCreateMessagesRequest][]. 422message BatchCreateMessagesRequest { 423 // Required. Resource identifier of the conversation to create message. 424 // Format: `projects/<Project ID>/locations/<Location 425 // ID>/conversations/<Conversation ID>`. 426 string parent = 1 [ 427 (google.api.field_behavior) = REQUIRED, 428 (google.api.resource_reference) = { 429 type: "dialogflow.googleapis.com/Conversation" 430 } 431 ]; 432 433 // Required. A maximum of 300 messages can be created in a batch. 434 // [CreateMessageRequest.message.send_time][] is required. All created 435 // messages will have identical 436 // [Message.create_time][google.cloud.dialogflow.v2beta1.Message.create_time]. 437 repeated CreateMessageRequest requests = 2 438 [(google.api.field_behavior) = REQUIRED]; 439} 440 441// The request message for [Conversations.BatchCreateMessagesResponse][]. 442message BatchCreateMessagesResponse { 443 // Messages created. 444 repeated Message messages = 1; 445} 446 447// The request message for 448// [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages]. 449message ListMessagesRequest { 450 // Required. The name of the conversation to list messages for. 451 // Format: `projects/<Project ID>/locations/<Location 452 // ID>/conversations/<Conversation ID>` 453 string parent = 1 [ 454 (google.api.field_behavior) = REQUIRED, 455 (google.api.resource_reference) = { 456 child_type: "dialogflow.googleapis.com/Message" 457 } 458 ]; 459 460 // Optional. Filter on message fields. Currently predicates on `create_time` 461 // and `create_time_epoch_microseconds` are supported. `create_time` only 462 // support milliseconds accuracy. E.g., 463 // `create_time_epoch_microseconds > 1551790877964485` or 464 // `create_time > "2017-01-15T01:30:15.01Z"`. 465 // 466 // For more information about filtering, see 467 // [API Filtering](https://aip.dev/160). 468 string filter = 4; 469 470 // Optional. The maximum number of items to return in a single page. By 471 // default 100 and at most 1000. 472 int32 page_size = 2; 473 474 // Optional. The next_page_token value returned from a previous list request. 475 string page_token = 3; 476} 477 478// The response message for 479// [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages]. 480message ListMessagesResponse { 481 // Required. The list of messages. There will be a maximum number of items 482 // returned based on the page_size field in the request. 483 // `messages` is sorted by `create_time` in descending order. 484 repeated Message messages = 1; 485 486 // Optional. Token to retrieve the next page of results, or empty if there are 487 // no more results in the list. 488 string next_page_token = 2; 489} 490 491// The request message for 492// [Conversations.SuggestConversationSummary][google.cloud.dialogflow.v2beta1.Conversations.SuggestConversationSummary]. 493message SuggestConversationSummaryRequest { 494 // Required. The conversation to fetch suggestion for. 495 // Format: `projects/<Project ID>/locations/<Location 496 // ID>/conversations/<Conversation ID>`. 497 string conversation = 1 [ 498 (google.api.field_behavior) = REQUIRED, 499 (google.api.resource_reference) = { 500 type: "dialogflow.googleapis.com/Conversation" 501 } 502 ]; 503 504 // The name of the latest conversation message used as context for 505 // compiling suggestion. If empty, the latest message of the conversation will 506 // be used. 507 // 508 // Format: `projects/<Project ID>/locations/<Location 509 // ID>/conversations/<Conversation ID>/messages/<Message ID>`. 510 string latest_message = 3 [(google.api.resource_reference) = { 511 type: "dialogflow.googleapis.com/Message" 512 }]; 513 514 // Max number of messages prior to and including 515 // [latest_message] to use as context when compiling the 516 // suggestion. By default 500 and at most 1000. 517 int32 context_size = 4; 518 519 // Parameters for a human assist query. Only used for POC/demo purpose. 520 AssistQueryParameters assist_query_params = 5; 521} 522 523// The response message for 524// [Conversations.SuggestConversationSummary][google.cloud.dialogflow.v2beta1.Conversations.SuggestConversationSummary]. 525message SuggestConversationSummaryResponse { 526 // Generated summary for a conversation. 527 message Summary { 528 // The summary content that is concatenated into one string. 529 string text = 1; 530 531 // The summary content that is divided into sections. The key is the 532 // section's name and the value is the section's content. There is no 533 // specific format for the key or value. 534 map<string, string> text_sections = 4; 535 536 // The name of the answer record. Format: 537 // "projects/<Project ID>/answerRecords/<Answer Record ID>" 538 string answer_record = 3 [(google.api.resource_reference) = { 539 type: "dialogflow.googleapis.com/AnswerRecord" 540 }]; 541 542 // The baseline model version used to generate this summary. It is empty if 543 // a baseline model was not used to generate this summary. 544 string baseline_model_version = 5; 545 } 546 547 // Generated summary. 548 Summary summary = 1; 549 550 // The name of the latest conversation message used as context for 551 // compiling suggestion. 552 // 553 // Format: `projects/<Project ID>/locations/<Location 554 // ID>/conversations/<Conversation ID>/messages/<Message ID>`. 555 string latest_message = 2 [(google.api.resource_reference) = { 556 type: "dialogflow.googleapis.com/Message" 557 }]; 558 559 // Number of messages prior to and including 560 // [last_conversation_message][] used to compile the suggestion. It may be 561 // smaller than the [SuggestSummaryRequest.context_size][] field in the 562 // request if there weren't that many messages in the conversation. 563 int32 context_size = 3; 564} 565 566// The request message for 567// [Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2beta1.Conversations.GenerateStatelessSummary]. 568message GenerateStatelessSummaryRequest { 569 // The minimum amount of information required to generate a Summary without 570 // having a Conversation resource created. 571 message MinimalConversation { 572 // Required. The messages that the Summary will be generated from. It is 573 // expected that this message content is already redacted and does not 574 // contain any PII. Required fields: {content, language_code, participant, 575 // participant_role} Optional fields: {send_time} If send_time is not 576 // provided, then the messages must be provided in chronological order. 577 repeated Message messages = 1 [(google.api.field_behavior) = REQUIRED]; 578 579 // Required. The parent resource to charge for the Summary's generation. 580 // Format: `projects/<Project ID>/locations/<Location ID>`. 581 string parent = 2 [ 582 (google.api.field_behavior) = REQUIRED, 583 (google.api.resource_reference) = { 584 type: "locations.googleapis.com/Location" 585 } 586 ]; 587 } 588 589 // Required. The conversation to suggest a summary for. 590 MinimalConversation stateless_conversation = 1 591 [(google.api.field_behavior) = REQUIRED]; 592 593 // Required. A ConversationProfile containing information required for Summary 594 // generation. 595 // Required fields: {language_code, security_settings} 596 // Optional fields: {agent_assistant_config} 597 ConversationProfile conversation_profile = 2 598 [(google.api.field_behavior) = REQUIRED]; 599 600 // The name of the latest conversation message used as context for 601 // generating a Summary. If empty, the latest message of the conversation will 602 // be used. The format is specific to the user and the names of the messages 603 // provided. 604 string latest_message = 3 [(google.api.resource_reference) = { 605 type: "dialogflow.googleapis.com/Message" 606 }]; 607 608 // Max number of messages prior to and including 609 // [latest_message] to use as context when compiling the 610 // suggestion. By default 500 and at most 1000. 611 int32 max_context_size = 4; 612} 613 614// The response message for 615// [Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2beta1.Conversations.GenerateStatelessSummary]. 616message GenerateStatelessSummaryResponse { 617 // Generated summary for a conversation. 618 message Summary { 619 // The summary content that is concatenated into one string. 620 string text = 1; 621 622 // The summary content that is divided into sections. The key is the 623 // section's name and the value is the section's content. There is no 624 // specific format for the key or value. 625 map<string, string> text_sections = 2; 626 627 // The baseline model version used to generate this summary. It is empty if 628 // a baseline model was not used to generate this summary. 629 string baseline_model_version = 4; 630 } 631 632 // Generated summary. 633 Summary summary = 1; 634 635 // The name of the latest conversation message used as context for 636 // compiling suggestion. The format is specific to the user and the names of 637 // the messages provided. 638 string latest_message = 2 [(google.api.resource_reference) = { 639 type: "dialogflow.googleapis.com/Message" 640 }]; 641 642 // Number of messages prior to and including 643 // [last_conversation_message][] used to compile the suggestion. It may be 644 // smaller than the [GenerateStatelessSummaryRequest.context_size][] field in 645 // the request if there weren't that many messages in the conversation. 646 int32 context_size = 3; 647} 648 649// The request message for 650// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2beta1.Conversations.SearchKnowledge]. 651message SearchKnowledgeRequest { 652 // The parent resource contains the conversation profile 653 // Format: 'projects/<Project ID>' or `projects/<Project 654 // ID>/locations/<Location ID>`. 655 string parent = 6; 656 657 // Required. The natural language text query for knowledge search. 658 TextInput query = 1 [(google.api.field_behavior) = REQUIRED]; 659 660 // Required. The conversation profile used to configure the search. 661 // Format: `projects/<Project ID>/locations/<Location 662 // ID>/conversationProfiles/<Conversation Profile ID>`. 663 string conversation_profile = 2 [ 664 (google.api.field_behavior) = REQUIRED, 665 (google.api.resource_reference) = { 666 type: "dialogflow.googleapis.com/ConversationProfile" 667 } 668 ]; 669 670 // The ID of the search session. 671 // The session_id can be combined with Dialogflow V3 Agent ID retrieved from 672 // conversation profile or on its own to identify a search session. The search 673 // history of the same session will impact the search result. It's up to the 674 // API caller to choose an appropriate `Session ID`. It can be a random number 675 // or some type of session identifiers (preferably hashed). The length must 676 // not exceed 36 characters. 677 string session_id = 3; 678 679 // The conversation (between human agent and end user) where the search 680 // request is triggered. Format: `projects/<Project ID>/locations/<Location 681 // ID>/conversations/<Conversation ID>`. 682 string conversation = 4 [(google.api.resource_reference) = { 683 type: "dialogflow.googleapis.com/Conversation" 684 }]; 685 686 // The name of the latest conversation message when the request is 687 // triggered. 688 // Format: `projects/<Project ID>/locations/<Location 689 // ID>/conversations/<Conversation ID>/messages/<Message ID>`. 690 string latest_message = 5 [(google.api.resource_reference) = { 691 type: "dialogflow.googleapis.com/Message" 692 }]; 693} 694 695// The response message for 696// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2beta1.Conversations.SearchKnowledge]. 697message SearchKnowledgeResponse { 698 // Most relevant snippets extracted from articles in the given knowledge base, 699 // ordered by confidence. 700 repeated SearchKnowledgeAnswer answers = 2; 701 702 // The rewritten query used to search knowledge. 703 string rewritten_query = 3; 704} 705 706// Represents a SearchKnowledge answer. 707message SearchKnowledgeAnswer { 708 // The type of the answer. 709 enum AnswerType { 710 // The answer has a unspecified type. 711 ANSWER_TYPE_UNSPECIFIED = 0; 712 713 // The answer is from FAQ documents. 714 FAQ = 1; 715 716 // The answer is from generative model. 717 GENERATIVE = 2; 718 719 // The answer is from intent matching. 720 INTENT = 3; 721 } 722 723 // The sources of the answers. 724 message AnswerSource { 725 // The title of the article. 726 string title = 1; 727 728 // The URI of the article. 729 string uri = 2; 730 731 // The relevant snippet of the article. 732 string snippet = 3; 733 } 734 735 // The piece of text from the knowledge base documents that answers 736 // the search query 737 string answer = 1; 738 739 // The type of the answer. 740 AnswerType answer_type = 2; 741 742 // All sources used to generate the answer. 743 repeated AnswerSource answer_sources = 3; 744 745 // The name of the answer record. 746 // Format: `projects/<Project ID>/locations/<location ID>/answer 747 // Records/<Answer Record ID>` 748 string answer_record = 5; 749} 750