answer_record.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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/participant.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option cc_enable_arenas = true;
  24. option csharp_namespace = "Google.Cloud.Dialogflow.V2";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "AnswerRecordsProto";
  28. option java_package = "com.google.cloud.dialogflow.v2";
  29. option objc_class_prefix = "DF";
  30. // Service for managing [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord].
  31. service AnswerRecords {
  32. option (google.api.default_host) = "dialogflow.googleapis.com";
  33. option (google.api.oauth_scopes) =
  34. "https://www.googleapis.com/auth/cloud-platform,"
  35. "https://www.googleapis.com/auth/dialogflow";
  36. // Returns the list of all answer records in the specified project in reverse
  37. // chronological order.
  38. rpc ListAnswerRecords(ListAnswerRecordsRequest) returns (ListAnswerRecordsResponse) {
  39. option (google.api.http) = {
  40. get: "/v2/{parent=projects/*}/answerRecords"
  41. additional_bindings {
  42. get: "/v2/{parent=projects/*/locations/*}/answerRecords"
  43. }
  44. };
  45. option (google.api.method_signature) = "parent";
  46. }
  47. // Updates the specified answer record.
  48. rpc UpdateAnswerRecord(UpdateAnswerRecordRequest) returns (AnswerRecord) {
  49. option (google.api.http) = {
  50. patch: "/v2/{answer_record.name=projects/*/answerRecords/*}"
  51. body: "answer_record"
  52. additional_bindings {
  53. patch: "/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}"
  54. body: "answer_record"
  55. }
  56. };
  57. option (google.api.method_signature) = "answer_record,update_mask";
  58. }
  59. }
  60. // Answer records are records to manage answer history and feedbacks for
  61. // Dialogflow.
  62. //
  63. // Currently, answer record includes:
  64. //
  65. // - human agent assistant article suggestion
  66. // - human agent assistant faq article
  67. //
  68. // It doesn't include:
  69. //
  70. // - `DetectIntent` intent matching
  71. // - `DetectIntent` knowledge
  72. //
  73. // Answer records are not related to the conversation history in the
  74. // Dialogflow Console. A Record is generated even when the end-user disables
  75. // conversation history in the console. Records are created when there's a human
  76. // agent assistant suggestion generated.
  77. //
  78. // A typical workflow for customers provide feedback to an answer is:
  79. //
  80. // 1. For human agent assistant, customers get suggestion via ListSuggestions
  81. // API. Together with the answers, [AnswerRecord.name][google.cloud.dialogflow.v2.AnswerRecord.name] are returned to the
  82. // customers.
  83. // 2. The customer uses the [AnswerRecord.name][google.cloud.dialogflow.v2.AnswerRecord.name] to call the
  84. // [UpdateAnswerRecord][] method to send feedback about a specific answer
  85. // that they believe is wrong.
  86. message AnswerRecord {
  87. option (google.api.resource) = {
  88. type: "dialogflow.googleapis.com/AnswerRecord"
  89. pattern: "projects/{project}/answerRecords/{answer_record}"
  90. pattern: "projects/{project}/locations/{location}/answerRecords/{answer_record}"
  91. };
  92. // The unique identifier of this answer record.
  93. // Format: `projects/<Project ID>/locations/<Location
  94. // ID>/answerRecords/<Answer Record ID>`.
  95. string name = 1;
  96. // Required. The AnswerFeedback for this record. You can set this with
  97. // [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] in order to give us feedback about
  98. // this answer.
  99. AnswerFeedback answer_feedback = 2 [(google.api.field_behavior) = REQUIRED];
  100. // The record for this answer.
  101. oneof record {
  102. // Output only. The record for human agent assistant.
  103. AgentAssistantRecord agent_assistant_record = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  104. }
  105. }
  106. // Request message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords].
  107. message ListAnswerRecordsRequest {
  108. // Required. The project to list all answer records for in reverse
  109. // chronological order. Format: `projects/<Project ID>/locations/<Location
  110. // ID>`.
  111. string parent = 1 [
  112. (google.api.field_behavior) = REQUIRED,
  113. (google.api.resource_reference) = {
  114. child_type: "dialogflow.googleapis.com/AnswerRecord"
  115. }
  116. ];
  117. // Optional. Filters to restrict results to specific answer records.
  118. //
  119. // Marked deprecated as it hasn't been, and isn't currently, supported.
  120. //
  121. // For more information about filtering, see
  122. // [API Filtering](https://aip.dev/160).
  123. string filter = 2 [
  124. deprecated = true,
  125. (google.api.field_behavior) = OPTIONAL
  126. ];
  127. // Optional. The maximum number of records to return in a single page.
  128. // The server may return fewer records than this. If unspecified, we use 10.
  129. // The maximum is 100.
  130. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  131. // Optional. The
  132. // [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token]
  133. // value returned from a previous list request used to continue listing on
  134. // the next page.
  135. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  136. }
  137. // Response message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords].
  138. message ListAnswerRecordsResponse {
  139. // The list of answer records.
  140. repeated AnswerRecord answer_records = 1;
  141. // A token to retrieve next page of results. Or empty if there are no more
  142. // results.
  143. // Pass this value in the
  144. // [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token]
  145. // field in the subsequent call to `ListAnswerRecords` method to retrieve the
  146. // next page of results.
  147. string next_page_token = 2;
  148. }
  149. // Request message for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord].
  150. message UpdateAnswerRecordRequest {
  151. // Required. Answer record to update.
  152. AnswerRecord answer_record = 1 [(google.api.field_behavior) = REQUIRED];
  153. // Required. The mask to control which fields get updated.
  154. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  155. }
  156. // Represents feedback the customer has about the quality & correctness of a
  157. // certain answer in a conversation.
  158. message AnswerFeedback {
  159. // The correctness level of an answer.
  160. enum CorrectnessLevel {
  161. // Correctness level unspecified.
  162. CORRECTNESS_LEVEL_UNSPECIFIED = 0;
  163. // Answer is totally wrong.
  164. NOT_CORRECT = 1;
  165. // Answer is partially correct.
  166. PARTIALLY_CORRECT = 2;
  167. // Answer is fully correct.
  168. FULLY_CORRECT = 3;
  169. }
  170. // The correctness level of the specific answer.
  171. CorrectnessLevel correctness_level = 1;
  172. // Normally, detail feedback is provided when answer is not fully correct.
  173. oneof detail_feedback {
  174. // Detail feedback of agent assist suggestions.
  175. AgentAssistantFeedback agent_assistant_detail_feedback = 2;
  176. }
  177. // Indicates whether the answer/item was clicked by the human agent
  178. // or not. Default to false.
  179. bool clicked = 3;
  180. // Time when the answer/item was clicked.
  181. google.protobuf.Timestamp click_time = 5;
  182. // Indicates whether the answer/item was displayed to the human
  183. // agent in the agent desktop UI. Default to false.
  184. bool displayed = 4;
  185. // Time when the answer/item was displayed.
  186. google.protobuf.Timestamp display_time = 6;
  187. }
  188. // Detail feedback of Agent Assist result.
  189. message AgentAssistantFeedback {
  190. // Relevance of an answer.
  191. enum AnswerRelevance {
  192. // Answer relevance unspecified.
  193. ANSWER_RELEVANCE_UNSPECIFIED = 0;
  194. // Answer is irrelevant to query.
  195. IRRELEVANT = 1;
  196. // Answer is relevant to query.
  197. RELEVANT = 2;
  198. }
  199. // Correctness of document.
  200. enum DocumentCorrectness {
  201. // Document correctness unspecified.
  202. DOCUMENT_CORRECTNESS_UNSPECIFIED = 0;
  203. // Information in document is incorrect.
  204. INCORRECT = 1;
  205. // Information in document is correct.
  206. CORRECT = 2;
  207. }
  208. // Efficiency of document.
  209. enum DocumentEfficiency {
  210. // Document efficiency unspecified.
  211. DOCUMENT_EFFICIENCY_UNSPECIFIED = 0;
  212. // Document is inefficient.
  213. INEFFICIENT = 1;
  214. // Document is efficient.
  215. EFFICIENT = 2;
  216. }
  217. // Optional. Whether or not the suggested answer is relevant.
  218. //
  219. // For example:
  220. //
  221. // * Query: "Can I change my mailing address?"
  222. // * Suggested document says: "Items must be returned/exchanged within 60
  223. // days of the purchase date."
  224. // * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT]
  225. AnswerRelevance answer_relevance = 1 [(google.api.field_behavior) = OPTIONAL];
  226. // Optional. Whether or not the information in the document is correct.
  227. //
  228. // For example:
  229. //
  230. // * Query: "Can I return the package in 2 days once received?"
  231. // * Suggested document says: "Items must be returned/exchanged within 60
  232. // days of the purchase date."
  233. // * Ground truth: "No return or exchange is allowed."
  234. // * [document_correctness]: INCORRECT
  235. DocumentCorrectness document_correctness = 2 [(google.api.field_behavior) = OPTIONAL];
  236. // Optional. Whether or not the suggested document is efficient. For example,
  237. // if the document is poorly written, hard to understand, hard to use or
  238. // too long to find useful information, [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] is
  239. // [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT].
  240. DocumentEfficiency document_efficiency = 3 [(google.api.field_behavior) = OPTIONAL];
  241. }
  242. // Represents a record of a human agent assist answer.
  243. message AgentAssistantRecord {
  244. // Output only. The agent assist answer.
  245. oneof answer {
  246. // Output only. The article suggestion answer.
  247. ArticleAnswer article_suggestion_answer = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  248. // Output only. The FAQ answer.
  249. FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  250. }
  251. }