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.cx.v3; 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/cx/v3/advanced_settings.proto"; 24import "google/cloud/dialogflow/cx/v3/audio_config.proto"; 25import "google/cloud/dialogflow/cx/v3/flow.proto"; 26import "google/longrunning/operations.proto"; 27import "google/protobuf/empty.proto"; 28import "google/protobuf/field_mask.proto"; 29import "google/protobuf/struct.proto"; 30 31option cc_enable_arenas = true; 32option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; 33option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; 34option java_multiple_files = true; 35option java_outer_classname = "AgentProto"; 36option java_package = "com.google.cloud.dialogflow.cx.v3"; 37option objc_class_prefix = "DF"; 38option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; 39 40// Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. 41service Agents { 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 // Returns the list of all agents in the specified location. 48 rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { 49 option (google.api.http) = { 50 get: "/v3/{parent=projects/*/locations/*}/agents" 51 }; 52 option (google.api.method_signature) = "parent"; 53 } 54 55 // Retrieves the specified agent. 56 rpc GetAgent(GetAgentRequest) returns (Agent) { 57 option (google.api.http) = { 58 get: "/v3/{name=projects/*/locations/*/agents/*}" 59 }; 60 option (google.api.method_signature) = "name"; 61 } 62 63 // Creates an agent in the specified location. 64 // 65 // Note: You should always train flows prior to sending them queries. See the 66 // [training 67 // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). 68 rpc CreateAgent(CreateAgentRequest) returns (Agent) { 69 option (google.api.http) = { 70 post: "/v3/{parent=projects/*/locations/*}/agents" 71 body: "agent" 72 }; 73 option (google.api.method_signature) = "parent,agent"; 74 } 75 76 // Updates the specified agent. 77 // 78 // Note: You should always train flows prior to sending them queries. See the 79 // [training 80 // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). 81 rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { 82 option (google.api.http) = { 83 patch: "/v3/{agent.name=projects/*/locations/*/agents/*}" 84 body: "agent" 85 }; 86 option (google.api.method_signature) = "agent,update_mask"; 87 } 88 89 // Deletes the specified agent. 90 rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { 91 option (google.api.http) = { 92 delete: "/v3/{name=projects/*/locations/*/agents/*}" 93 }; 94 option (google.api.method_signature) = "name"; 95 } 96 97 // Exports the specified agent to a binary file. 98 // 99 // This method is a [long-running 100 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 101 // The returned `Operation` type has the following method-specific fields: 102 // 103 // - `metadata`: An empty [Struct 104 // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) 105 // - `response`: 106 // [ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse] 107 rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { 108 option (google.api.http) = { 109 post: "/v3/{name=projects/*/locations/*/agents/*}:export" 110 body: "*" 111 }; 112 option (google.longrunning.operation_info) = { 113 response_type: "ExportAgentResponse" 114 metadata_type: "google.protobuf.Struct" 115 }; 116 } 117 118 // Restores the specified agent from a binary file. 119 // 120 // Replaces the current agent with a new one. Note that all existing resources 121 // in agent (e.g. intents, entity types, flows) will be removed. 122 // 123 // This method is a [long-running 124 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 125 // The returned `Operation` type has the following method-specific fields: 126 // 127 // - `metadata`: An empty [Struct 128 // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) 129 // - `response`: An [Empty 130 // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) 131 // 132 // Note: You should always train flows prior to sending them queries. See the 133 // [training 134 // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). 135 rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { 136 option (google.api.http) = { 137 post: "/v3/{name=projects/*/locations/*/agents/*}:restore" 138 body: "*" 139 }; 140 option (google.longrunning.operation_info) = { 141 response_type: "google.protobuf.Empty" 142 metadata_type: "google.protobuf.Struct" 143 }; 144 } 145 146 // Validates the specified agent and creates or updates validation results. 147 // The agent in draft version is validated. Please call this API after the 148 // training is completed to get the complete validation results. 149 rpc ValidateAgent(ValidateAgentRequest) returns (AgentValidationResult) { 150 option (google.api.http) = { 151 post: "/v3/{name=projects/*/locations/*/agents/*}:validate" 152 body: "*" 153 }; 154 } 155 156 // Gets the latest agent validation result. Agent validation is performed 157 // when ValidateAgent is called. 158 rpc GetAgentValidationResult(GetAgentValidationResultRequest) 159 returns (AgentValidationResult) { 160 option (google.api.http) = { 161 get: "/v3/{name=projects/*/locations/*/agents/*/validationResult}" 162 }; 163 option (google.api.method_signature) = "name"; 164 } 165} 166 167// Settings related to speech recognition. 168message SpeechToTextSettings { 169 // Whether to use speech adaptation for speech recognition. 170 bool enable_speech_adaptation = 1; 171} 172 173// Agents are best described as Natural Language Understanding (NLU) modules 174// that transform user requests into actionable data. You can include agents 175// in your app, product, or service to determine user intent and respond to the 176// user in a natural way. 177// 178// After you create an agent, you can add 179// [Intents][google.cloud.dialogflow.cx.v3.Intent], [Entity 180// Types][google.cloud.dialogflow.cx.v3.EntityType], 181// [Flows][google.cloud.dialogflow.cx.v3.Flow], 182// [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], 183// [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and so on to manage the 184// conversation flows.. 185message Agent { 186 option (google.api.resource) = { 187 type: "dialogflow.googleapis.com/Agent" 188 pattern: "projects/{project}/locations/{location}/agents/{agent}" 189 }; 190 191 // The unique identifier of the agent. 192 // Required for the 193 // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] 194 // method. 195 // [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent] 196 // populates the name automatically. 197 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 198 string name = 1; 199 200 // Required. The human-readable name of the agent, unique within the location. 201 string display_name = 2 [(google.api.field_behavior) = REQUIRED]; 202 203 // Required. Immutable. The default language of the agent as a language tag. 204 // See [Language 205 // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) 206 // for a list of the currently supported language codes. 207 // This field cannot be set by the 208 // [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] 209 // method. 210 string default_language_code = 3 [ 211 (google.api.field_behavior) = REQUIRED, 212 (google.api.field_behavior) = IMMUTABLE 213 ]; 214 215 // The list of all languages supported by the agent (except for the 216 // `default_language_code`). 217 repeated string supported_language_codes = 4; 218 219 // Required. The time zone of the agent from the [time zone 220 // database](https://www.iana.org/time-zones), e.g., America/New_York, 221 // Europe/Paris. 222 string time_zone = 5 [(google.api.field_behavior) = REQUIRED]; 223 224 // The description of the agent. The maximum length is 500 characters. If 225 // exceeded, the request is rejected. 226 string description = 6; 227 228 // The URI of the agent's avatar. Avatars are used throughout the Dialogflow 229 // console and in the self-hosted [Web 230 // Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) 231 // integration. 232 string avatar_uri = 7; 233 234 // Speech recognition related settings. 235 SpeechToTextSettings speech_to_text_settings = 13; 236 237 // Immutable. Name of the start flow in this agent. A start flow will be 238 // automatically created when the agent is created, and can only be deleted by 239 // deleting the agent. Format: `projects/<Project ID>/locations/<Location 240 // ID>/agents/<Agent ID>/flows/<Flow ID>`. 241 string start_flow = 16 [ 242 (google.api.field_behavior) = IMMUTABLE, 243 (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } 244 ]; 245 246 // Name of the 247 // [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] 248 // reference for the agent. Format: `projects/<Project ID>/locations/<Location 249 // ID>/securitySettings/<Security Settings ID>`. 250 string security_settings = 17 [(google.api.resource_reference) = { 251 type: "dialogflow.googleapis.com/SecuritySettings" 252 }]; 253 254 // Indicates if stackdriver logging is enabled for the agent. 255 // Please use 256 // [agent.advanced_settings][google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettings] 257 // instead. 258 bool enable_stackdriver_logging = 18 [deprecated = true]; 259 260 // Indicates if automatic spell correction is enabled in detect intent 261 // requests. 262 bool enable_spell_correction = 20; 263 264 // Indicates whether the agent is locked for changes. If the agent is locked, 265 // modifications to the agent will be rejected except for [RestoreAgent][]. 266 bool locked = 27; 267 268 // Hierarchical advanced settings for this agent. The settings exposed at the 269 // lower level overrides the settings exposed at the higher level. 270 AdvancedSettings advanced_settings = 22; 271 272 // Settings on instructing the speech synthesizer on how to generate the 273 // output audio content. 274 TextToSpeechSettings text_to_speech_settings = 31; 275} 276 277// The request message for 278// [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. 279message ListAgentsRequest { 280 // Required. The location to list all agents for. 281 // Format: `projects/<Project ID>/locations/<Location ID>`. 282 string parent = 1 [ 283 (google.api.field_behavior) = REQUIRED, 284 (google.api.resource_reference) = { 285 child_type: "dialogflow.googleapis.com/Agent" 286 } 287 ]; 288 289 // The maximum number of items to return in a single page. By default 100 and 290 // at most 1000. 291 int32 page_size = 2; 292 293 // The next_page_token value returned from a previous list request. 294 string page_token = 3; 295} 296 297// The response message for 298// [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. 299message ListAgentsResponse { 300 // The list of agents. There will be a maximum number of items returned based 301 // on the page_size field in the request. 302 repeated Agent agents = 1; 303 304 // Token to retrieve the next page of results, or empty if there are no more 305 // results in the list. 306 string next_page_token = 2; 307} 308 309// The request message for 310// [Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent]. 311message GetAgentRequest { 312 // Required. The name of the agent. 313 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 314 string name = 1 [ 315 (google.api.field_behavior) = REQUIRED, 316 (google.api.resource_reference) = { 317 type: "dialogflow.googleapis.com/Agent" 318 } 319 ]; 320} 321 322// The request message for 323// [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent]. 324message CreateAgentRequest { 325 // Required. The location to create a agent for. 326 // Format: `projects/<Project ID>/locations/<Location ID>`. 327 string parent = 1 [ 328 (google.api.field_behavior) = REQUIRED, 329 (google.api.resource_reference) = { 330 child_type: "dialogflow.googleapis.com/Agent" 331 } 332 ]; 333 334 // Required. The agent to create. 335 Agent agent = 2 [(google.api.field_behavior) = REQUIRED]; 336} 337 338// The request message for 339// [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]. 340message UpdateAgentRequest { 341 // Required. The agent to update. 342 Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; 343 344 // The mask to control which fields get updated. If the mask is not present, 345 // all fields will be updated. 346 google.protobuf.FieldMask update_mask = 2; 347} 348 349// The request message for 350// [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent]. 351message DeleteAgentRequest { 352 // Required. The name of the agent to delete. 353 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 354 string name = 1 [ 355 (google.api.field_behavior) = REQUIRED, 356 (google.api.resource_reference) = { 357 type: "dialogflow.googleapis.com/Agent" 358 } 359 ]; 360} 361 362// The request message for 363// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. 364message ExportAgentRequest { 365 // Data format of the exported agent. 366 enum DataFormat { 367 // Unspecified format. 368 DATA_FORMAT_UNSPECIFIED = 0; 369 370 // Agent content will be exported as raw bytes. 371 BLOB = 1; 372 373 // Agent content will be exported in JSON Package format. 374 JSON_PACKAGE = 4; 375 } 376 377 // Required. The name of the agent to export. 378 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 379 string name = 1 [ 380 (google.api.field_behavior) = REQUIRED, 381 (google.api.resource_reference) = { 382 type: "dialogflow.googleapis.com/Agent" 383 } 384 ]; 385 386 // Optional. The [Google Cloud 387 // Storage](https://cloud.google.com/storage/docs/) URI to export the agent 388 // to. The format of this URI must be `gs://<bucket-name>/<object-name>`. If 389 // left unspecified, the serialized agent is returned inline. 390 // 391 // Dialogflow performs a write operation for the Cloud Storage object 392 // on the caller's behalf, so your request authentication must 393 // have write permissions for the object. For more information, see 394 // [Dialogflow access 395 // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). 396 string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL]; 397 398 // Optional. The data format of the exported agent. If not specified, `BLOB` 399 // is assumed. 400 DataFormat data_format = 3 [(google.api.field_behavior) = OPTIONAL]; 401 402 // Optional. Environment name. If not set, draft environment is assumed. 403 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 404 // ID>/environments/<Environment ID>`. 405 string environment = 5 [ 406 (google.api.field_behavior) = OPTIONAL, 407 (google.api.resource_reference) = { 408 type: "dialogflow.googleapis.com/Environment" 409 } 410 ]; 411} 412 413// The response message for 414// [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. 415message ExportAgentResponse { 416 // The exported agent. 417 oneof agent { 418 // The URI to a file containing the exported agent. This field is populated 419 // if `agent_uri` is specified in 420 // [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest]. 421 string agent_uri = 1; 422 423 // Uncompressed raw byte content for agent. 424 bytes agent_content = 2; 425 } 426} 427 428// The request message for 429// [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent]. 430message RestoreAgentRequest { 431 // Restore option. 432 enum RestoreOption { 433 // Unspecified. Treated as KEEP. 434 RESTORE_OPTION_UNSPECIFIED = 0; 435 436 // Always respect the settings from the exported agent file. It may cause 437 // a restoration failure if some settings (e.g. model type) are not 438 // supported in the target agent. 439 KEEP = 1; 440 441 // Fallback to default settings if some settings are not supported in the 442 // target agent. 443 FALLBACK = 2; 444 } 445 446 // Required. The name of the agent to restore into. 447 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 448 string name = 1 [ 449 (google.api.field_behavior) = REQUIRED, 450 (google.api.resource_reference) = { 451 type: "dialogflow.googleapis.com/Agent" 452 } 453 ]; 454 455 // Required. The agent to restore. 456 oneof agent { 457 // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI 458 // to restore agent from. The format of this URI must be 459 // `gs://<bucket-name>/<object-name>`. 460 // 461 // Dialogflow performs a read operation for the Cloud Storage object 462 // on the caller's behalf, so your request authentication must 463 // have read permissions for the object. For more information, see 464 // [Dialogflow access 465 // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). 466 string agent_uri = 2; 467 468 // Uncompressed raw byte content for agent. 469 bytes agent_content = 3; 470 } 471 472 // Agent restore mode. If not specified, `KEEP` is assumed. 473 RestoreOption restore_option = 5; 474} 475 476// The request message for 477// [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent]. 478message ValidateAgentRequest { 479 // Required. The agent to validate. 480 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 481 string name = 1 [ 482 (google.api.field_behavior) = REQUIRED, 483 (google.api.resource_reference) = { 484 type: "dialogflow.googleapis.com/Agent" 485 } 486 ]; 487 488 // If not specified, the agent's default language is used. 489 string language_code = 2; 490} 491 492// The request message for 493// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. 494message GetAgentValidationResultRequest { 495 // Required. The agent name. 496 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 497 // ID>/validationResult`. 498 string name = 1 [ 499 (google.api.field_behavior) = REQUIRED, 500 (google.api.resource_reference) = { 501 type: "dialogflow.googleapis.com/AgentValidationResult" 502 } 503 ]; 504 505 // If not specified, the agent's default language is used. 506 string language_code = 2; 507} 508 509// The response message for 510// [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. 511message AgentValidationResult { 512 option (google.api.resource) = { 513 type: "dialogflow.googleapis.com/AgentValidationResult" 514 pattern: "projects/{project}/locations/{location}/agents/{agent}/validationResult" 515 }; 516 517 // The unique identifier of the agent validation result. 518 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 519 // ID>/validationResult`. 520 string name = 1; 521 522 // Contains all flow validation results. 523 repeated FlowValidationResult flow_validation_results = 2; 524} 525