|
| 1 | +// Copyright 2021 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.dialogflow.v2beta1; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/api/client.proto"; |
| 21 | +import "google/api/field_behavior.proto"; |
| 22 | +import "google/api/resource.proto"; |
| 23 | +import "google/cloud/dialogflow/v2beta1/participant.proto"; |
| 24 | +import "google/protobuf/empty.proto"; |
| 25 | +import "google/protobuf/field_mask.proto"; |
| 26 | +import "google/protobuf/timestamp.proto"; |
| 27 | + |
| 28 | +option cc_enable_arenas = true; |
| 29 | +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; |
| 30 | +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; |
| 31 | +option java_multiple_files = true; |
| 32 | +option java_outer_classname = "AnswerRecordsProto"; |
| 33 | +option java_package = "com.google.cloud.dialogflow.v2beta1"; |
| 34 | +option objc_class_prefix = "DF"; |
| 35 | + |
| 36 | +// Service for managing [AnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecord]. |
| 37 | +service AnswerRecords { |
| 38 | + option (google.api.default_host) = "dialogflow.googleapis.com"; |
| 39 | + option (google.api.oauth_scopes) = |
| 40 | + "https://www.googleapis.com/auth/cloud-platform," |
| 41 | + "https://www.googleapis.com/auth/dialogflow"; |
| 42 | + |
| 43 | + // Deprecated. |
| 44 | + // Retrieves a specific answer record. |
| 45 | + rpc GetAnswerRecord(GetAnswerRecordRequest) returns (AnswerRecord) { |
| 46 | + option deprecated = true; |
| 47 | + option (google.api.http) = { |
| 48 | + get: "/v2beta1/{name=projects/*/answerRecords/*}" |
| 49 | + additional_bindings { |
| 50 | + get: "/v2beta1/{name=projects/*/locations/*/answerRecords/*}" |
| 51 | + } |
| 52 | + }; |
| 53 | + } |
| 54 | + |
| 55 | + // Returns the list of all answer records in the specified project in reverse |
| 56 | + // chronological order. |
| 57 | + rpc ListAnswerRecords(ListAnswerRecordsRequest) returns (ListAnswerRecordsResponse) { |
| 58 | + option (google.api.http) = { |
| 59 | + get: "/v2beta1/{parent=projects/*}/answerRecords" |
| 60 | + additional_bindings { |
| 61 | + get: "/v2beta1/{parent=projects/*/locations/*}/answerRecords" |
| 62 | + } |
| 63 | + }; |
| 64 | + option (google.api.method_signature) = "parent"; |
| 65 | + } |
| 66 | + |
| 67 | + // Updates the specified answer record. |
| 68 | + rpc UpdateAnswerRecord(UpdateAnswerRecordRequest) returns (AnswerRecord) { |
| 69 | + option (google.api.http) = { |
| 70 | + patch: "/v2beta1/{answer_record.name=projects/*/answerRecords/*}" |
| 71 | + body: "answer_record" |
| 72 | + additional_bindings { |
| 73 | + patch: "/v2beta1/{answer_record.name=projects/*/locations/*/answerRecords/*}" |
| 74 | + body: "answer_record" |
| 75 | + } |
| 76 | + }; |
| 77 | + option (google.api.method_signature) = "answer_record,update_mask"; |
| 78 | + } |
| 79 | +} |
| 80 | + |
| 81 | +// Answer records are records to manage answer history and feedbacks for |
| 82 | +// Dialogflow. |
| 83 | +// |
| 84 | +// Currently, answer record includes: |
| 85 | +// |
| 86 | +// - human agent assistant article suggestion |
| 87 | +// - human agent assistant faq article |
| 88 | +// |
| 89 | +// It doesn't include: |
| 90 | +// |
| 91 | +// - `DetectIntent` intent matching |
| 92 | +// - `DetectIntent` knowledge |
| 93 | +// |
| 94 | +// Answer records are not related to the conversation history in the |
| 95 | +// Dialogflow Console. A Record is generated even when the end-user disables |
| 96 | +// conversation history in the console. Records are created when there's a human |
| 97 | +// agent assistant suggestion generated. |
| 98 | +// |
| 99 | +// A typical workflow for customers provide feedback to an answer is: |
| 100 | +// |
| 101 | +// 1. For human agent assistant, customers get suggestion via ListSuggestions |
| 102 | +// API. Together with the answers, [AnswerRecord.name][google.cloud.dialogflow.v2beta1.AnswerRecord.name] are returned to the |
| 103 | +// customers. |
| 104 | +// 2. The customer uses the [AnswerRecord.name][google.cloud.dialogflow.v2beta1.AnswerRecord.name] to call the |
| 105 | +// [UpdateAnswerRecord][] method to send feedback about a specific answer |
| 106 | +// that they believe is wrong. |
| 107 | +message AnswerRecord { |
| 108 | + option (google.api.resource) = { |
| 109 | + type: "dialogflow.googleapis.com/AnswerRecord" |
| 110 | + pattern: "projects/{project}/answerRecords/{answer_record}" |
| 111 | + pattern: "projects/{project}/locations/{location}/answerRecords/{answer_record}" |
| 112 | + }; |
| 113 | + |
| 114 | + // The unique identifier of this answer record. |
| 115 | + // Required for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] method. |
| 116 | + // Format: `projects/<Project ID>/locations/<Location |
| 117 | + // ID>/answerRecords/<Answer Record ID>`. |
| 118 | + string name = 1; |
| 119 | + |
| 120 | + // Optional. The AnswerFeedback for this record. You can set this with |
| 121 | + // [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] in order to give us feedback about |
| 122 | + // this answer. |
| 123 | + AnswerFeedback answer_feedback = 3; |
| 124 | + |
| 125 | + // Output only. The record for this answer. |
| 126 | + oneof record { |
| 127 | + // Output only. The record for human agent assistant. |
| 128 | + AgentAssistantRecord agent_assistant_record = 4; |
| 129 | + } |
| 130 | +} |
| 131 | + |
| 132 | +// Represents a record of a human agent assistant answer. |
| 133 | +message AgentAssistantRecord { |
| 134 | + // Output only. The agent assistant answer. |
| 135 | + oneof answer { |
| 136 | + // Output only. The article suggestion answer. |
| 137 | + ArticleAnswer article_suggestion_answer = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 138 | + |
| 139 | + // Output only. The FAQ answer. |
| 140 | + FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 141 | + } |
| 142 | +} |
| 143 | + |
| 144 | +// Represents feedback the customer has about the quality & correctness of a |
| 145 | +// certain answer in a conversation. |
| 146 | +message AnswerFeedback { |
| 147 | + // The correctness level of an answer. |
| 148 | + enum CorrectnessLevel { |
| 149 | + // Correctness level unspecified. |
| 150 | + CORRECTNESS_LEVEL_UNSPECIFIED = 0; |
| 151 | + |
| 152 | + // Answer is totally wrong. |
| 153 | + NOT_CORRECT = 1; |
| 154 | + |
| 155 | + // Answer is partially correct. |
| 156 | + PARTIALLY_CORRECT = 2; |
| 157 | + |
| 158 | + // Answer is fully correct. |
| 159 | + FULLY_CORRECT = 3; |
| 160 | + } |
| 161 | + |
| 162 | + // The correctness level of the specific answer. |
| 163 | + CorrectnessLevel correctness_level = 1; |
| 164 | + |
| 165 | + // Normally, detail feedback is provided when answer is not fully correct. |
| 166 | + oneof detail_feedback { |
| 167 | + // Optional. Detail feedback of agent assistant suggestions. |
| 168 | + AgentAssistantFeedback agent_assistant_detail_feedback = 2; |
| 169 | + } |
| 170 | + |
| 171 | + // Indicates whether the answer/item was clicked by the human agent |
| 172 | + // or not. Default to false. |
| 173 | + bool clicked = 3; |
| 174 | + |
| 175 | + // Time when the answer/item was clicked. |
| 176 | + google.protobuf.Timestamp click_time = 5; |
| 177 | + |
| 178 | + // Indicates whether the answer/item was displayed to the human |
| 179 | + // agent in the agent desktop UI. Default to false. |
| 180 | + bool displayed = 4; |
| 181 | + |
| 182 | + // Time when the answer/item was displayed. |
| 183 | + google.protobuf.Timestamp display_time = 6; |
| 184 | +} |
| 185 | + |
| 186 | +// Detail feedback of Agent Assistant result. |
| 187 | +message AgentAssistantFeedback { |
| 188 | + // Feedback for conversation summarization. |
| 189 | + message SummarizationFeedback { |
| 190 | + // Timestamp when composing of the summary starts. |
| 191 | + google.protobuf.Timestamp start_timestamp = 1; |
| 192 | + |
| 193 | + // Timestamp when the summary was submitted. |
| 194 | + google.protobuf.Timestamp submit_timestamp = 2; |
| 195 | + |
| 196 | + // Text of actual submitted summary. |
| 197 | + string summary_text = 3; |
| 198 | + } |
| 199 | + |
| 200 | + // Relevance of an answer. |
| 201 | + enum AnswerRelevance { |
| 202 | + // Answer relevance unspecified. |
| 203 | + ANSWER_RELEVANCE_UNSPECIFIED = 0; |
| 204 | + |
| 205 | + // Answer is irrelevant to query. |
| 206 | + IRRELEVANT = 1; |
| 207 | + |
| 208 | + // Answer is relevant to query. |
| 209 | + RELEVANT = 2; |
| 210 | + } |
| 211 | + |
| 212 | + // Correctness of document. |
| 213 | + enum DocumentCorrectness { |
| 214 | + // Document correctness unspecified. |
| 215 | + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; |
| 216 | + |
| 217 | + // Information in document is incorrect. |
| 218 | + INCORRECT = 1; |
| 219 | + |
| 220 | + // Information in document is correct. |
| 221 | + CORRECT = 2; |
| 222 | + } |
| 223 | + |
| 224 | + // Efficiency of document. |
| 225 | + enum DocumentEfficiency { |
| 226 | + // Document efficiency unspecified. |
| 227 | + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; |
| 228 | + |
| 229 | + // Document is inefficient. |
| 230 | + INEFFICIENT = 1; |
| 231 | + |
| 232 | + // Document is efficient. |
| 233 | + EFFICIENT = 2; |
| 234 | + } |
| 235 | + |
| 236 | + // Optional. Whether or not the suggested answer is relevant. |
| 237 | + // |
| 238 | + // For example: |
| 239 | + // |
| 240 | + // * Query: "Can I change my mailing address?" |
| 241 | + // * Suggested document says: "Items must be returned/exchanged within 60 |
| 242 | + // days of the purchase date." |
| 243 | + // * [answer_relevance][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] |
| 244 | + AnswerRelevance answer_relevance = 1; |
| 245 | + |
| 246 | + // Optional. Whether or not the information in the document is correct. |
| 247 | + // |
| 248 | + // For example: |
| 249 | + // |
| 250 | + // * Query: "Can I return the package in 2 days once received?" |
| 251 | + // * Suggested document says: "Items must be returned/exchanged within 60 |
| 252 | + // days of the purchase date." |
| 253 | + // * Ground truth: "No return or exchange is allowed." |
| 254 | + // * [document_correctness]: INCORRECT |
| 255 | + DocumentCorrectness document_correctness = 2; |
| 256 | + |
| 257 | + // Optional. Whether or not the suggested document is efficient. For example, |
| 258 | + // if the document is poorly written, hard to understand, hard to use or |
| 259 | + // too long to find useful information, [document_efficiency][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.document_efficiency] is |
| 260 | + // [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. |
| 261 | + DocumentEfficiency document_efficiency = 3; |
| 262 | + |
| 263 | + // Feedback for conversation summarization. |
| 264 | + SummarizationFeedback summarization_feedback = 4; |
| 265 | +} |
| 266 | + |
| 267 | +// Request message for [AnswerRecords.GetAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.GetAnswerRecord]. |
| 268 | +message GetAnswerRecordRequest { |
| 269 | + // Required. The name of the answer record to retrieve. |
| 270 | + // Format: `projects/<Project ID>/locations/<Location |
| 271 | + // ID>/answerRecords/<Answer Record Id>`. |
| 272 | + string name = 1; |
| 273 | +} |
| 274 | + |
| 275 | +// Request message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords]. |
| 276 | +message ListAnswerRecordsRequest { |
| 277 | + // Required. The project to list all answer records for in reverse |
| 278 | + // chronological order. Format: `projects/<Project ID>/locations/<Location |
| 279 | + // ID>`. |
| 280 | + string parent = 1 [(google.api.resource_reference) = { |
| 281 | + child_type: "dialogflow.googleapis.com/AnswerRecord" |
| 282 | + }]; |
| 283 | + |
| 284 | + // Optional. The maximum number of records to return in a single page. |
| 285 | + // The server may return fewer records than this. If unspecified, we use 10. |
| 286 | + // The maximum is 100. |
| 287 | + int32 page_size = 3; |
| 288 | + |
| 289 | + // Optional. The |
| 290 | + // [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token] |
| 291 | + // value returned from a previous list request used to continue listing on |
| 292 | + // the next page. |
| 293 | + string page_token = 4; |
| 294 | +} |
| 295 | + |
| 296 | +// Response message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords]. |
| 297 | +message ListAnswerRecordsResponse { |
| 298 | + // The list of answer records. |
| 299 | + repeated AnswerRecord answer_records = 1; |
| 300 | + |
| 301 | + // A token to retrieve next page of results. Or empty if there are no more |
| 302 | + // results. |
| 303 | + // Pass this value in the |
| 304 | + // [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.page_token] |
| 305 | + // field in the subsequent call to `ListAnswerRecords` method to retrieve the |
| 306 | + // next page of results. |
| 307 | + string next_page_token = 2; |
| 308 | +} |
| 309 | + |
| 310 | +// Request message for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord]. |
| 311 | +message UpdateAnswerRecordRequest { |
| 312 | + // Required. Answer record to update. |
| 313 | + AnswerRecord answer_record = 1 [ |
| 314 | + (google.api.field_behavior) = REQUIRED, |
| 315 | + (google.api.resource_reference) = { |
| 316 | + type: "dialogflow.googleapis.com/AnswerRecord" |
| 317 | + } |
| 318 | + ]; |
| 319 | + |
| 320 | + // Required. The mask to control which fields get updated. |
| 321 | + google.protobuf.FieldMask update_mask = 2; |
| 322 | +} |
0 commit comments