answer_record.proto 12 KB

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