Skip to content

Commit ef119e7

Browse files
Google APIscopybara-github
authored andcommitted
feat: Expose supported languages of the agent;
feat: add export / import flow API docs: Update docs on Pages, Session, Version, etc. PiperOrigin-RevId: 370860251
1 parent cfa6e02 commit ef119e7

9 files changed

Lines changed: 324 additions & 110 deletions

File tree

google/cloud/dialogflow/cx/v3/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,7 @@ ruby_grpc_library(
313313
ruby_cloud_gapic_library(
314314
name = "cx_ruby_gapic",
315315
srcs = [":cx_proto_with_info"],
316-
extra_protoc_parameters = [
317-
"ruby-cloud-gem-name=google-cloud-dialogflow-cx-v3",
318-
],
316+
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-dialogflow-cx-v3"],
319317
grpc_service_config = "dialogflow_grpc_service_config.json",
320318
deps = [
321319
":cx_ruby_grpc",

google/cloud/dialogflow/cx/v3/agent.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/dialogflow/cx/v3/flow.proto";
24+
import "google/cloud/dialogflow/cx/v3/security_settings.proto";
2425
import "google/longrunning/operations.proto";
2526
import "google/protobuf/empty.proto";
2627
import "google/protobuf/field_mask.proto";
@@ -165,6 +166,10 @@ message Agent {
165166
// This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] method.
166167
string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE];
167168

169+
// The list of all languages supported by the agent (except for the
170+
// `default_language_code`).
171+
repeated string supported_language_codes = 4;
172+
168173
// Required. The time zone of the agent from the [time zone
169174
// database](https://www.iana.org/time-zones), e.g., America/New_York,
170175
// Europe/Paris.
@@ -305,6 +310,16 @@ message ExportAgentRequest {
305310
// `gs://<bucket-name>/<object-name>`.
306311
// If left unspecified, the serialized agent is returned inline.
307312
string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL];
313+
314+
// Optional. Environment name. If not set, draft environment is assumed.
315+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
316+
// ID>/environments/<Environment ID>`.
317+
string environment = 5 [
318+
(google.api.field_behavior) = OPTIONAL,
319+
(google.api.resource_reference) = {
320+
type: "dialogflow.googleapis.com/Environment"
321+
}
322+
];
308323
}
309324

310325
// The response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent].

google/cloud/dialogflow/cx/v3/dialogflow_v3.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ types:
2424
- name: google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse
2525
- name: google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata
2626
- name: google.cloud.dialogflow.cx.v3.ExportAgentResponse
27+
- name: google.cloud.dialogflow.cx.v3.ExportFlowResponse
2728
- name: google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata
2829
- name: google.cloud.dialogflow.cx.v3.ExportTestCasesResponse
30+
- name: google.cloud.dialogflow.cx.v3.ImportFlowResponse
2931
- name: google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata
3032
- name: google.cloud.dialogflow.cx.v3.ImportTestCasesResponse
3133
- name: google.cloud.dialogflow.cx.v3.RunTestCaseMetadata

google/cloud/dialogflow/cx/v3/experiment.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ message Experiment {
174174
// Version variant and associated metrics.
175175
message VersionMetrics {
176176
// The name of the flow [Version][google.cloud.dialogflow.cx.v3.Version].
177-
// Format: `projects/<Project Number>/locations/<Location
177+
// Format: `projects/<Project ID>/locations/<Location
178178
// ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
179179
string version = 1 [(google.api.resource_reference) = {
180180
type: "dialogflow.googleapis.com/Version"

google/cloud/dialogflow/cx/v3/flow.proto

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,33 @@ service Flows {
116116
};
117117
option (google.api.method_signature) = "name";
118118
}
119+
120+
// Imports the specified flow to the specified agent from a binary file.
121+
rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) {
122+
option (google.api.http) = {
123+
post: "/v3/{parent=projects/*/locations/*/agents/*}/flows:import"
124+
body: "*"
125+
};
126+
option (google.longrunning.operation_info) = {
127+
response_type: "ImportFlowResponse"
128+
metadata_type: "google.protobuf.Struct"
129+
};
130+
}
131+
132+
// Exports the specified flow to a binary file.
133+
//
134+
// Note that resources (e.g. intents, entities, webhooks) that the flow
135+
// references will also be exported.
136+
rpc ExportFlow(ExportFlowRequest) returns (google.longrunning.Operation) {
137+
option (google.api.http) = {
138+
post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:export"
139+
body: "*"
140+
};
141+
option (google.longrunning.operation_info) = {
142+
response_type: "ExportFlowResponse"
143+
metadata_type: "google.protobuf.Struct"
144+
};
145+
}
119146
}
120147

121148
// Settings related to NLU.
@@ -260,7 +287,9 @@ message CreateFlowRequest {
260287
// The language of the following fields in `flow`:
261288
//
262289
// * `Flow.event_handlers.trigger_fulfillment.messages`
290+
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
263291
// * `Flow.transition_routes.trigger_fulfillment.messages`
292+
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
264293
//
265294
// If not specified, the agent's default language is used.
266295
// [Many
@@ -317,7 +346,9 @@ message ListFlowsRequest {
317346
// dependent:
318347
//
319348
// * `Flow.event_handlers.trigger_fulfillment.messages`
349+
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
320350
// * `Flow.transition_routes.trigger_fulfillment.messages`
351+
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
321352
//
322353
// If not specified, the agent's default language is used.
323354
// [Many
@@ -354,7 +385,9 @@ message GetFlowRequest {
354385
// dependent:
355386
//
356387
// * `Flow.event_handlers.trigger_fulfillment.messages`
388+
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
357389
// * `Flow.transition_routes.trigger_fulfillment.messages`
390+
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
358391
//
359392
// If not specified, the agent's default language is used.
360393
// [Many
@@ -376,7 +409,9 @@ message UpdateFlowRequest {
376409
// The language of the following fields in `flow`:
377410
//
378411
// * `Flow.event_handlers.trigger_fulfillment.messages`
412+
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
379413
// * `Flow.transition_routes.trigger_fulfillment.messages`
414+
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
380415
//
381416
// If not specified, the agent's default language is used.
382417
// [Many
@@ -449,3 +484,90 @@ message FlowValidationResult {
449484
// Last time the flow was validated.
450485
google.protobuf.Timestamp update_time = 3;
451486
}
487+
488+
// The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow].
489+
message ImportFlowRequest {
490+
// Import option.
491+
enum ImportOption {
492+
// Unspecified. Treated as `KEEP`.
493+
IMPORT_OPTION_UNSPECIFIED = 0;
494+
495+
// Always respect settings in exported flow content. It may cause a
496+
// import failure if some settings (e.g. custom NLU) are not supported in
497+
// the agent to import into.
498+
KEEP = 1;
499+
500+
// Fallback to default settings if some settings are not supported in the
501+
// agent to import into. E.g. Standard NLU will be used if custom NLU is
502+
// not available.
503+
FALLBACK = 2;
504+
}
505+
506+
// Required. The agent to import the flow into.
507+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
508+
string parent = 1 [
509+
(google.api.field_behavior) = REQUIRED,
510+
(google.api.resource_reference) = {
511+
child_type: "dialogflow.googleapis.com/Flow"
512+
}
513+
];
514+
515+
// Required. The flow to import.
516+
oneof flow {
517+
// The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
518+
// to import flow from. The format of this URI must be
519+
// `gs://<bucket-name>/<object-name>`.
520+
string flow_uri = 2;
521+
522+
// Uncompressed raw byte content for flow.
523+
bytes flow_content = 3;
524+
}
525+
526+
// Flow import mode. If not specified, `KEEP` is assumed.
527+
ImportOption import_option = 4;
528+
}
529+
530+
// The response message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow].
531+
message ImportFlowResponse {
532+
// The unique identifier of the new flow.
533+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
534+
// ID>/flows/<Flow ID>`.
535+
string flow = 1 [(google.api.resource_reference) = {
536+
type: "dialogflow.googleapis.com/Flow"
537+
}];
538+
}
539+
540+
// The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow].
541+
message ExportFlowRequest {
542+
// Required. The name of the flow to export.
543+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
544+
// ID>/flows/<Flow ID>`.
545+
string name = 1 [
546+
(google.api.field_behavior) = REQUIRED,
547+
(google.api.resource_reference) = {
548+
type: "dialogflow.googleapis.com/Flow"
549+
}
550+
];
551+
552+
// Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
553+
// export the flow to. The format of this URI must be
554+
// `gs://<bucket-name>/<object-name>`.
555+
// If left unspecified, the serialized flow is returned inline.
556+
string flow_uri = 2 [(google.api.field_behavior) = OPTIONAL];
557+
558+
// Optional. Whether to export flows referenced by the specified flow.
559+
bool include_referenced_flows = 4 [(google.api.field_behavior) = OPTIONAL];
560+
}
561+
562+
// The response message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow].
563+
message ExportFlowResponse {
564+
// The exported flow.
565+
oneof flow {
566+
// The URI to a file containing the exported flow. This field is populated
567+
// only if `flow_uri` is specified in [ExportFlowRequest][google.cloud.dialogflow.cx.v3.ExportFlowRequest].
568+
string flow_uri = 1;
569+
570+
// Uncompressed raw byte content for flow.
571+
bytes flow_content = 2;
572+
}
573+
}

google/cloud/dialogflow/cx/v3/page.proto

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,17 @@ message ListPagesRequest {
378378
// dependent:
379379
//
380380
// * `Page.entry_fulfillment.messages`
381+
// * `Page.entry_fulfillment.conditional_cases`
382+
// * `Page.event_handlers.trigger_fulfillment.messages`
383+
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
381384
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
385+
// *
386+
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
382387
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
383-
// * `Page.transition_routes.trigger_fulfillment.messages`
384388
// *
385-
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
389+
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
390+
// * `Page.transition_routes.trigger_fulfillment.messages`
391+
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
386392
//
387393
// If not specified, the agent's default language is used.
388394
// [Many
@@ -426,11 +432,17 @@ message GetPageRequest {
426432
// dependent:
427433
//
428434
// * `Page.entry_fulfillment.messages`
435+
// * `Page.entry_fulfillment.conditional_cases`
436+
// * `Page.event_handlers.trigger_fulfillment.messages`
437+
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
429438
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
439+
// *
440+
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
430441
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
431-
// * `Page.transition_routes.trigger_fulfillment.messages`
432442
// *
433-
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
443+
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
444+
// * `Page.transition_routes.trigger_fulfillment.messages`
445+
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
434446
//
435447
// If not specified, the agent's default language is used.
436448
// [Many
@@ -458,11 +470,17 @@ message CreatePageRequest {
458470
// The language of the following fields in `page`:
459471
//
460472
// * `Page.entry_fulfillment.messages`
473+
// * `Page.entry_fulfillment.conditional_cases`
474+
// * `Page.event_handlers.trigger_fulfillment.messages`
475+
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
461476
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
477+
// *
478+
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
462479
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
463-
// * `Page.transition_routes.trigger_fulfillment.messages`
464480
// *
465-
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
481+
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
482+
// * `Page.transition_routes.trigger_fulfillment.messages`
483+
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
466484
//
467485
// If not specified, the agent's default language is used.
468486
// [Many
@@ -480,11 +498,17 @@ message UpdatePageRequest {
480498
// The language of the following fields in `page`:
481499
//
482500
// * `Page.entry_fulfillment.messages`
501+
// * `Page.entry_fulfillment.conditional_cases`
502+
// * `Page.event_handlers.trigger_fulfillment.messages`
503+
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
483504
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
505+
// *
506+
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
484507
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
485-
// * `Page.transition_routes.trigger_fulfillment.messages`
486508
// *
487-
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
509+
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
510+
// * `Page.transition_routes.trigger_fulfillment.messages`
511+
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
488512
//
489513
// If not specified, the agent's default language is used.
490514
// [Many

0 commit comments

Comments
 (0)