conversation_dataset.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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/gcs.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/timestamp.proto";
  23. import "google/rpc/status.proto";
  24. option cc_enable_arenas = true;
  25. option csharp_namespace = "Google.Cloud.Dialogflow.V2";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "ConversationDatasetProto";
  29. option java_package = "com.google.cloud.dialogflow.v2";
  30. option objc_class_prefix = "DF";
  31. // Conversation datasets.
  32. //
  33. // Conversation datasets contain raw conversation files and their
  34. // customizable metadata that can be used for model training.
  35. service ConversationDatasets {
  36. option (google.api.default_host) = "dialogflow.googleapis.com";
  37. option (google.api.oauth_scopes) =
  38. "https://www.googleapis.com/auth/cloud-platform,"
  39. "https://www.googleapis.com/auth/dialogflow";
  40. // Creates a new conversation dataset.
  41. //
  42. // This method is a [long-running
  43. // operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
  44. // The returned `Operation` type has the following method-specific fields:
  45. //
  46. // - `metadata`: [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata]
  47. // - `response`: [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset]
  48. rpc CreateConversationDataset(CreateConversationDatasetRequest) returns (google.longrunning.Operation) {
  49. option (google.api.http) = {
  50. post: "/v2/{parent=projects/*/locations/*}/conversationDatasets"
  51. body: "conversation_dataset"
  52. };
  53. option (google.api.method_signature) = "parent,conversation_dataset";
  54. option (google.longrunning.operation_info) = {
  55. response_type: "ConversationDataset"
  56. metadata_type: "CreateConversationDatasetOperationMetadata"
  57. };
  58. }
  59. // Retrieves the specified conversation dataset.
  60. rpc GetConversationDataset(GetConversationDatasetRequest) returns (ConversationDataset) {
  61. option (google.api.http) = {
  62. get: "/v2/{name=projects/*/conversationDatasets/*}"
  63. additional_bindings {
  64. get: "/v2/{name=projects/*/locations/*/conversationDatasets/*}"
  65. }
  66. };
  67. option (google.api.method_signature) = "name";
  68. }
  69. // Returns the list of all conversation datasets in the specified
  70. // project and location.
  71. rpc ListConversationDatasets(ListConversationDatasetsRequest) returns (ListConversationDatasetsResponse) {
  72. option (google.api.http) = {
  73. get: "/v2/{parent=projects/*}/conversationDatasets"
  74. additional_bindings {
  75. get: "/v2/{parent=projects/*/locations/*}/conversationDatasets"
  76. }
  77. };
  78. option (google.api.method_signature) = "parent";
  79. }
  80. // Deletes the specified conversation dataset.
  81. //
  82. // This method is a [long-running
  83. // operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
  84. // The returned `Operation` type has the following method-specific fields:
  85. //
  86. // - `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata]
  87. // - `response`: An [Empty
  88. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
  89. rpc DeleteConversationDataset(DeleteConversationDatasetRequest) returns (google.longrunning.Operation) {
  90. option (google.api.http) = {
  91. delete: "/v2/{name=projects/*/locations/*/conversationDatasets/*}"
  92. };
  93. option (google.api.method_signature) = "name";
  94. option (google.longrunning.operation_info) = {
  95. response_type: "google.protobuf.Empty"
  96. metadata_type: "DeleteConversationDatasetOperationMetadata"
  97. };
  98. }
  99. // Import data into the specified conversation dataset. Note that it
  100. // is not allowed to import data to a conversation dataset that
  101. // already has data in it.
  102. //
  103. // This method is a [long-running
  104. // operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
  105. // The returned `Operation` type has the following method-specific fields:
  106. //
  107. // - `metadata`: [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata]
  108. // - `response`: [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse]
  109. rpc ImportConversationData(ImportConversationDataRequest) returns (google.longrunning.Operation) {
  110. option (google.api.http) = {
  111. post: "/v2/{name=projects/*/conversationDatasets/*}:importConversationData"
  112. body: "*"
  113. additional_bindings {
  114. post: "/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData"
  115. body: "*"
  116. }
  117. };
  118. option (google.longrunning.operation_info) = {
  119. response_type: "ImportConversationDataOperationResponse"
  120. metadata_type: "ImportConversationDataOperationMetadata"
  121. };
  122. }
  123. }
  124. // Represents metadata of a conversation.
  125. message ConversationInfo {
  126. // Optional. The language code of the conversation data within this dataset. See
  127. // https://cloud.google.com/apis/design/standard_fields for more information.
  128. // Supports all UTF-8 languages.
  129. string language_code = 1 [(google.api.field_behavior) = OPTIONAL];
  130. }
  131. // Represents the configuration of importing a set of conversation files in
  132. // Google Cloud Storage.
  133. message InputConfig {
  134. // Required. Where the data is from.
  135. oneof source {
  136. // The Cloud Storage URI has the form gs://<Google Cloud Storage bucket
  137. // name>//agent*.json. Wildcards are allowed and will be expanded into all
  138. // matched JSON files, which will be read as one conversation per file.
  139. GcsSources gcs_source = 1;
  140. }
  141. }
  142. // Represents a conversation dataset that a user imports raw data into.
  143. // The data inside ConversationDataset can not be changed after
  144. // ImportConversationData finishes (and calling ImportConversationData on a
  145. // dataset that already has data is not allowed).
  146. message ConversationDataset {
  147. option (google.api.resource) = {
  148. type: "dialogflow.googleapis.com/ConversationDataset"
  149. pattern: "projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}"
  150. };
  151. // Output only. ConversationDataset resource name. Format:
  152. // `projects/<Project ID>/locations/<Location
  153. // ID>/conversationDatasets/<Conversation Dataset ID>`
  154. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  155. // Required. The display name of the dataset. Maximum of 64 bytes.
  156. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  157. // Optional. The description of the dataset. Maximum of 10000 bytes.
  158. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  159. // Output only. Creation time of this dataset.
  160. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // Output only. Input configurations set during conversation data import.
  162. InputConfig input_config = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Output only. Metadata set during conversation data import.
  164. ConversationInfo conversation_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  165. // Output only. The number of conversations this conversation dataset contains.
  166. int64 conversation_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  167. }
  168. // The request message for
  169. // [ConversationDatasets.CreateConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset].
  170. message CreateConversationDatasetRequest {
  171. // Required. The project to create conversation dataset for. Format:
  172. // `projects/<Project ID>/locations/<Location ID>`
  173. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  174. // Required. The conversation dataset to create.
  175. ConversationDataset conversation_dataset = 2 [(google.api.field_behavior) = REQUIRED];
  176. }
  177. // The request message for
  178. // [ConversationDatasets.GetConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset].
  179. message GetConversationDatasetRequest {
  180. // Required. The conversation dataset to retrieve. Format:
  181. // `projects/<Project ID>/locations/<Location
  182. // ID>/conversationDatasets/<Conversation Dataset ID>`
  183. string name = 1 [
  184. (google.api.field_behavior) = REQUIRED,
  185. (google.api.resource_reference) = {
  186. type: "dialogflow.googleapis.com/ConversationDataset"
  187. }
  188. ];
  189. }
  190. // The request message for
  191. // [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets].
  192. message ListConversationDatasetsRequest {
  193. // Required. The project and location name to list all conversation datasets for.
  194. // Format: `projects/<Project ID>/locations/<Location ID>`
  195. string parent = 1 [
  196. (google.api.field_behavior) = REQUIRED,
  197. (google.api.resource_reference) = {
  198. child_type: "dialogflow.googleapis.com/ConversationDataset"
  199. }
  200. ];
  201. // Optional. Maximum number of conversation datasets to return in a single
  202. // page. By default 100 and at most 1000.
  203. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  204. // Optional. The next_page_token value returned from a previous list request.
  205. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  206. }
  207. // The response message for
  208. // [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets].
  209. message ListConversationDatasetsResponse {
  210. // The list of datasets to return.
  211. repeated ConversationDataset conversation_datasets = 1;
  212. // The token to use to retrieve the next page of results, or empty if there
  213. // are no more results in the list.
  214. string next_page_token = 2;
  215. }
  216. // The request message for
  217. // [ConversationDatasets.DeleteConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset].
  218. message DeleteConversationDatasetRequest {
  219. // Required. The conversation dataset to delete. Format:
  220. // `projects/<Project ID>/locations/<Location
  221. // ID>/conversationDatasets/<Conversation Dataset ID>`
  222. string name = 1 [
  223. (google.api.field_behavior) = REQUIRED,
  224. (google.api.resource_reference) = {
  225. type: "dialogflow.googleapis.com/ConversationDataset"
  226. }
  227. ];
  228. }
  229. // The request message for [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData].
  230. message ImportConversationDataRequest {
  231. // Required. Dataset resource name. Format:
  232. // `projects/<Project ID>/locations/<Location
  233. // ID>/conversationDatasets/<Conversation Dataset ID>`
  234. string name = 1 [
  235. (google.api.field_behavior) = REQUIRED,
  236. (google.api.resource_reference) = {
  237. type: "dialogflow.googleapis.com/ConversationDataset"
  238. }
  239. ];
  240. // Required. Configuration describing where to import data from.
  241. InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED];
  242. }
  243. // Metadata for a [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] operation.
  244. message ImportConversationDataOperationMetadata {
  245. // The resource name of the imported conversation dataset. Format:
  246. // `projects/<Project ID>/locations/<Location
  247. // ID>/conversationDatasets/<Conversation Dataset Id>`
  248. string conversation_dataset = 1 [(google.api.resource_reference) = {
  249. type: "dialogflow.googleapis.com/ConversationDataset"
  250. }];
  251. // Partial failures are failures that don't fail the whole long running
  252. // operation, e.g. single files that couldn't be read.
  253. repeated google.rpc.Status partial_failures = 2;
  254. // Timestamp when import conversation data request was created. The time is
  255. // measured on server side.
  256. google.protobuf.Timestamp create_time = 3;
  257. }
  258. // Response used for [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] long
  259. // running operation.
  260. message ImportConversationDataOperationResponse {
  261. // The resource name of the imported conversation dataset. Format:
  262. // `projects/<Project ID>/locations/<Location
  263. // ID>/conversationDatasets/<Conversation Dataset Id>`
  264. string conversation_dataset = 1 [(google.api.resource_reference) = {
  265. type: "dialogflow.googleapis.com/ConversationDataset"
  266. }];
  267. // Number of conversations imported successfully.
  268. int32 import_count = 3;
  269. }
  270. // Metadata for [ConversationDatasets][CreateConversationDataset].
  271. message CreateConversationDatasetOperationMetadata {
  272. // The resource name of the conversation dataset that will be created. Format:
  273. // `projects/<Project ID>/locations/<Location
  274. // ID>/conversationDatasets/<Conversation Dataset Id>`
  275. string conversation_dataset = 1 [(google.api.resource_reference) = {
  276. type: "dialogflow.googleapis.com/ConversationDataset"
  277. }];
  278. }
  279. // Metadata for [ConversationDatasets][DeleteConversationDataset].
  280. message DeleteConversationDatasetOperationMetadata {
  281. }