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