-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
agent.proto
574 lines (514 loc) · 21.4 KB
/
agent.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/dialogflow/v2/validation_result.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb";
option java_multiple_files = true;
option java_outer_classname = "AgentProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// Service for managing [Agents][google.cloud.dialogflow.v2.Agent].
service Agents {
option (google.api.default_host) = "dialogflow.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/dialogflow";
// Retrieves the specified agent.
rpc GetAgent(GetAgentRequest) returns (Agent) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/agent"
additional_bindings { get: "/v2/{parent=projects/*/locations/*}/agent" }
};
option (google.api.method_signature) = "parent";
}
// Creates/updates the specified agent.
//
// Note: You should always train an agent prior to sending it queries. See the
// [training
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
rpc SetAgent(SetAgentRequest) returns (Agent) {
option (google.api.http) = {
post: "/v2/{agent.parent=projects/*}/agent"
body: "agent"
additional_bindings {
post: "/v2/{agent.parent=projects/*/locations/*}/agent"
body: "agent"
}
};
option (google.api.method_signature) = "agent";
}
// Deletes the specified agent.
rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{parent=projects/*}/agent"
additional_bindings {
delete: "/v2/{parent=projects/*/locations/*}/agent"
}
};
option (google.api.method_signature) = "parent";
}
// Returns the list of agents.
//
// Since there is at most one conversational agent per project, this method is
// useful primarily for listing all agents across projects the caller has
// access to. One can achieve that with a wildcard project collection id "-".
// Refer to [List
// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/agent:search"
additional_bindings {
get: "/v2/{parent=projects/*/locations/*}/agent:search"
}
};
option (google.api.method_signature) = "parent";
}
// Trains the specified agent.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
// The returned `Operation` type has the following method-specific fields:
//
// - `metadata`: An empty [Struct
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
// - `response`: An [Empty
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
//
// Note: You should always train an agent prior to sending it queries. See the
// [training
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:train"
body: "*"
additional_bindings {
post: "/v2/{parent=projects/*/locations/*}/agent:train"
body: "*"
}
};
option (google.api.method_signature) = "parent";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.protobuf.Struct"
};
}
// Exports the specified agent to a ZIP file.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
// The returned `Operation` type has the following method-specific fields:
//
// - `metadata`: An empty [Struct
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
// - `response`:
// [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:export"
body: "*"
additional_bindings {
post: "/v2/{parent=projects/*/locations/*}/agent:export"
body: "*"
}
};
option (google.api.method_signature) = "parent";
option (google.longrunning.operation_info) = {
response_type: "google.cloud.dialogflow.v2.ExportAgentResponse"
metadata_type: "google.protobuf.Struct"
};
}
// Imports the specified agent from a ZIP file.
//
// Uploads new intents and entity types without deleting the existing ones.
// Intents and entity types with the same name are replaced with the new
// versions from
// [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After
// the import, the imported draft agent will be trained automatically (unless
// disabled in agent settings). However, once the import is done, training may
// not be completed yet. Please call
// [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the
// operation it returns in order to train explicitly.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
// The returned `Operation` type has the following method-specific fields:
//
// - `metadata`: An empty [Struct
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
// - `response`: An [Empty
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
//
// The operation only tracks when importing is complete, not when it is done
// training.
//
// Note: You should always train an agent prior to sending it queries. See the
// [training
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:import"
body: "*"
additional_bindings {
post: "/v2/{parent=projects/*/locations/*}/agent:import"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.protobuf.Struct"
};
}
// Restores the specified agent from a ZIP file.
//
// Replaces the current agent version with a new one. All the intents and
// entity types in the older version are deleted. After the restore, the
// restored draft agent will be trained automatically (unless disabled in
// agent settings). However, once the restore is done, training may not be
// completed yet. Please call
// [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the
// operation it returns in order to train explicitly.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
// The returned `Operation` type has the following method-specific fields:
//
// - `metadata`: An empty [Struct
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
// - `response`: An [Empty
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
//
// The operation only tracks when restoring is complete, not when it is done
// training.
//
// Note: You should always train an agent prior to sending it queries. See the
// [training
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/agent:restore"
body: "*"
additional_bindings {
post: "/v2/{parent=projects/*/locations/*}/agent:restore"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.protobuf.Struct"
};
}
// Gets agent validation result. Agent validation is performed during
// training time and is updated automatically when training is completed.
rpc GetValidationResult(GetValidationResultRequest)
returns (ValidationResult) {
option (google.api.http) = {
get: "/v2/{parent=projects/*}/agent/validationResult"
additional_bindings {
get: "/v2/{parent=projects/*/locations/*}/agent/validationResult"
}
};
}
}
// A Dialogflow agent is a virtual agent that handles conversations with your
// end-users. It is a natural language understanding module that understands the
// nuances of human language. Dialogflow translates end-user text or audio
// during a conversation to structured data that your apps and services can
// understand. You design and build a Dialogflow agent to handle the types of
// conversations required for your system.
//
// For more information about agents, see the
// [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview).
//
message Agent {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Agent"
pattern: "projects/{project}/agent"
pattern: "projects/{project}/locations/{location}/agent"
};
// Match mode determines how intents are detected from user queries.
enum MatchMode {
// Not specified.
MATCH_MODE_UNSPECIFIED = 0;
// Best for agents with a small number of examples in intents and/or wide
// use of templates syntax and composite entities.
MATCH_MODE_HYBRID = 1;
// Can be used for agents with a large number of examples in intents,
// especially the ones using @sys.any or very large custom entities.
MATCH_MODE_ML_ONLY = 2;
}
// API version for the agent.
enum ApiVersion {
// Not specified.
API_VERSION_UNSPECIFIED = 0;
// Legacy V1 API.
API_VERSION_V1 = 1;
// V2 API.
API_VERSION_V2 = 2;
// V2beta1 API.
API_VERSION_V2_BETA_1 = 3;
}
// Represents the agent tier.
enum Tier {
// Not specified. This value should never be used.
TIER_UNSPECIFIED = 0;
// Trial Edition, previously known as Standard Edition.
TIER_STANDARD = 1;
// Essentials Edition, previously known as Enterprise Essential Edition.
TIER_ENTERPRISE = 2;
// Essentials Edition (same as TIER_ENTERPRISE), previously known as
// Enterprise Plus Edition.
TIER_ENTERPRISE_PLUS = 3 [deprecated = true];
}
// Required. The project of this agent.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
// Required. The name of this agent.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The default language of the agent as a language tag. See
// [Language
// Support](https://cloud.google.com/dialogflow/docs/reference/language)
// for a list of the currently supported language codes. This field cannot be
// set by the `Update` method.
string default_language_code = 3 [(google.api.field_behavior) = REQUIRED];
// Optional. The list of all languages supported by this agent (except for the
// `default_language_code`).
repeated string supported_language_codes = 4
[(google.api.field_behavior) = OPTIONAL];
// Required. The time zone of this agent from the
// [time zone database](https://www.iana.org/time-zones), e.g.,
// America/New_York, Europe/Paris.
string time_zone = 5 [(google.api.field_behavior) = REQUIRED];
// Optional. The description of this agent.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. The URI of the agent's avatar.
// Avatars are used throughout the Dialogflow console and in the self-hosted
// [Web
// Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
// integration.
string avatar_uri = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. Determines whether this agent should log conversation queries.
bool enable_logging = 8 [(google.api.field_behavior) = OPTIONAL];
// Optional. Determines how intents are detected from user queries.
MatchMode match_mode = 9
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
// Optional. To filter out false positive results and still get variety in
// matched natural language inputs for your agent, you can tune the machine
// learning classification threshold. If the returned score value is less than
// the threshold value, then a fallback intent will be triggered or, if there
// are no fallback intents defined, no intent will be triggered. The score
// values range from 0.0 (completely uncertain) to 1.0 (completely certain).
// If set to 0.0, the default of 0.3 is used.
float classification_threshold = 10 [(google.api.field_behavior) = OPTIONAL];
// Optional. API version displayed in Dialogflow console. If not specified,
// V2 API is assumed. Clients are free to query different service endpoints
// for different API versions. However, bots connectors and webhook calls will
// follow the specified API version.
ApiVersion api_version = 14 [(google.api.field_behavior) = OPTIONAL];
// Optional. The agent tier. If not specified, TIER_STANDARD is assumed.
Tier tier = 15 [(google.api.field_behavior) = OPTIONAL];
}
// The request message for
// [Agents.GetAgent][google.cloud.dialogflow.v2.Agents.GetAgent].
message GetAgentRequest {
// Required. The project that the agent to fetch is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
}
// The request message for
// [Agents.SetAgent][google.cloud.dialogflow.v2.Agents.SetAgent].
message SetAgentRequest {
// Required. The agent to update.
Agent agent = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = OPTIONAL];
}
// The request message for
// [Agents.DeleteAgent][google.cloud.dialogflow.v2.Agents.DeleteAgent].
message DeleteAgentRequest {
// Required. The project that the agent to delete is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
}
// The request message for
// [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents].
message SearchAgentsRequest {
// Required. The project to list agents from.
// Format: `projects/<Project ID or '-'>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for
// [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents].
message SearchAgentsResponse {
// The list of agents. There will be a maximum number of items returned based
// on the page_size field in the request.
repeated Agent agents = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for
// [Agents.TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent].
message TrainAgentRequest {
// Required. The project that the agent to train is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
}
// The request message for
// [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent].
message ExportAgentRequest {
// Required. The project that the agent to export is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
// Required. The [Google Cloud
// Storage](https://cloud.google.com/storage/docs/) URI to export the agent
// to. The format of this URI must be `gs://<bucket-name>/<object-name>`. If
// left unspecified, the serialized agent is returned inline.
//
// Dialogflow performs a write operation for the Cloud Storage object
// on the caller's behalf, so your request authentication must
// have write permissions for the object. For more information, see
// [Dialogflow access
// control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
string agent_uri = 2 [(google.api.field_behavior) = REQUIRED];
}
// The response message for
// [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent].
message ExportAgentResponse {
// The exported agent.
oneof agent {
// The URI to a file containing the exported agent. This field is populated
// only if `agent_uri` is specified in `ExportAgentRequest`.
string agent_uri = 1;
// Zip compressed raw byte content for agent.
bytes agent_content = 2;
}
}
// The request message for
// [Agents.ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent].
message ImportAgentRequest {
// Required. The project that the agent to import is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
// Required. The agent to import.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to import.
// Note: The URI must start with "gs://".
//
// Dialogflow performs a read operation for the Cloud Storage object
// on the caller's behalf, so your request authentication must
// have read permissions for the object. For more information, see
// [Dialogflow access
// control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
string agent_uri = 2;
// Zip compressed raw byte content for agent.
bytes agent_content = 3;
}
}
// The request message for
// [Agents.RestoreAgent][google.cloud.dialogflow.v2.Agents.RestoreAgent].
message RestoreAgentRequest {
// Required. The project that the agent to restore is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
// Required. The agent to restore.
oneof agent {
// The URI to a Google Cloud Storage file containing the agent to restore.
// Note: The URI must start with "gs://".
//
// Dialogflow performs a read operation for the Cloud Storage object
// on the caller's behalf, so your request authentication must
// have read permissions for the object. For more information, see
// [Dialogflow access
// control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
string agent_uri = 2;
// Zip compressed raw byte content for agent.
bytes agent_content = 3;
}
}
// The request message for
// [Agents.GetValidationResult][google.cloud.dialogflow.v2.Agents.GetValidationResult].
message GetValidationResultRequest {
// Required. The project that the agent is associated with.
// Format: `projects/<Project ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Agent"
}
];
// Optional. The language for which you want a validation result. If not
// specified, the agent's default language is used. [Many
// languages](https://cloud.google.com/dialogflow/docs/reference/language)
// are supported. Note: languages must be enabled in the agent before they can
// be used.
string language_code = 3 [(google.api.field_behavior) = OPTIONAL];
}