agent.proto 19 KB

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