Skip to content

Commit bf8851e

Browse files
Google APIscopybara-github
authored andcommitted
feat: added deployment API
feat: exposed DTMF input info in the query result docs: added notes on long running operation PiperOrigin-RevId: 400785744
1 parent 02710fa commit bf8851e

11 files changed

Lines changed: 401 additions & 34 deletions

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ proto_library(
2424
"advanced_settings.proto",
2525
"agent.proto",
2626
"audio_config.proto",
27+
"deployment.proto",
2728
"entity_type.proto",
2829
"environment.proto",
2930
"experiment.proto",
@@ -96,20 +97,18 @@ java_gapic_library(
9697
service_yaml = "dialogflow_v3.yaml",
9798
test_deps = [
9899
":cx_java_grpc",
99-
"//google/cloud/location:location_java_grpc",
100100
],
101101
deps = [
102102
":cx_java_proto",
103103
"//google/api:api_java_proto",
104-
"//google/cloud/location:location_java_grpc",
105-
"//google/cloud/location:location_java_proto",
106104
],
107105
)
108106

109107
java_gapic_test(
110108
name = "cx_java_gapic_test_suite",
111109
test_classes = [
112110
"com.google.cloud.dialogflow.cx.v3.AgentsClientTest",
111+
"com.google.cloud.dialogflow.cx.v3.DeploymentsClientTest",
113112
"com.google.cloud.dialogflow.cx.v3.EntityTypesClientTest",
114113
"com.google.cloud.dialogflow.cx.v3.EnvironmentsClientTest",
115114
"com.google.cloud.dialogflow.cx.v3.ExperimentsClientTest",
@@ -135,9 +134,6 @@ java_gapic_assembly_gradle_pkg(
135134
":cx_java_grpc",
136135
":cx_java_proto",
137136
":cx_proto",
138-
"//google/cloud/location:location_java_grpc",
139-
"//google/cloud/location:location_java_proto",
140-
"//google/cloud/location:location_proto",
141137
],
142138
)
143139

@@ -174,7 +170,6 @@ go_gapic_library(
174170
service_yaml = "dialogflow_v3.yaml",
175171
deps = [
176172
":cx_go_proto",
177-
"//google/cloud/location:location_go_proto",
178173
"//google/longrunning:longrunning_go_proto",
179174
"@com_google_cloud_go//longrunning:go_default_library",
180175
"@com_google_cloud_go//longrunning/autogen:go_default_library",

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ service Agents {
9494
}
9595

9696
// Exports the specified agent to a binary file.
97+
//
9798
// This method is a [long-running
9899
// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
99100
// The returned `Operation` type has the following method-specific fields:
@@ -117,6 +118,14 @@ service Agents {
117118
// Replaces the current agent with a new one. Note that all existing resources
118119
// in agent (e.g. intents, entity types, flows) will be removed.
119120
//
121+
// This method is a [long-running
122+
// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
123+
// The returned `Operation` type has the following method-specific fields:
124+
//
125+
// - `metadata`: An empty [Struct
126+
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
127+
// - `response`: An [Empty
128+
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
120129
//
121130
// Note: You should always train flows prior to sending them queries. See the
122131
// [training

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,31 @@ option java_package = "com.google.cloud.dialogflow.cx.v3";
3131
option objc_class_prefix = "DF";
3232
option ruby_package = "Google::Cloud::Dialogflow::CX::V3";
3333

34+
// Information for a word recognized by the speech recognizer.
35+
message SpeechWordInfo {
36+
// The word this info is for.
37+
string word = 3;
38+
39+
// Time offset relative to the beginning of the audio that corresponds to the
40+
// start of the spoken word. This is an experimental feature and the accuracy
41+
// of the time offset can vary.
42+
google.protobuf.Duration start_offset = 1;
43+
44+
// Time offset relative to the beginning of the audio that corresponds to the
45+
// end of the spoken word. This is an experimental feature and the accuracy of
46+
// the time offset can vary.
47+
google.protobuf.Duration end_offset = 2;
48+
49+
// The Speech confidence between 0.0 and 1.0 for this word. A higher number
50+
// indicates an estimated greater likelihood that the recognized word is
51+
// correct. The default of 0.0 is a sentinel value indicating that confidence
52+
// was not set.
53+
//
54+
// This field is not guaranteed to be fully stable over time for the same
55+
// audio input. Users should also not rely on it to always be provided.
56+
float confidence = 4;
57+
}
58+
3459
// Audio encoding of the audio content sent in the conversational query request.
3560
// Refer to the
3661
// [Cloud Speech API
@@ -80,31 +105,6 @@ enum AudioEncoding {
80105
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
81106
}
82107

83-
// Information for a word recognized by the speech recognizer.
84-
message SpeechWordInfo {
85-
// The word this info is for.
86-
string word = 3;
87-
88-
// Time offset relative to the beginning of the audio that corresponds to the
89-
// start of the spoken word. This is an experimental feature and the accuracy
90-
// of the time offset can vary.
91-
google.protobuf.Duration start_offset = 1;
92-
93-
// Time offset relative to the beginning of the audio that corresponds to the
94-
// end of the spoken word. This is an experimental feature and the accuracy of
95-
// the time offset can vary.
96-
google.protobuf.Duration end_offset = 2;
97-
98-
// The Speech confidence between 0.0 and 1.0 for this word. A higher number
99-
// indicates an estimated greater likelihood that the recognized word is
100-
// correct. The default of 0.0 is a sentinel value indicating that confidence
101-
// was not set.
102-
//
103-
// This field is not guaranteed to be fully stable over time for the same
104-
// audio input. Users should also not rely on it to always be provided.
105-
float confidence = 4;
106-
}
107-
108108
// Instructs the speech recognizer on how to process the audio content.
109109
message InputAudioConfig {
110110
// Required. Audio encoding of the audio content to process.
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
// Copyright 2021 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.dialogflow.cx.v3;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/protobuf/empty.proto";
24+
import "google/protobuf/field_mask.proto";
25+
import "google/protobuf/timestamp.proto";
26+
27+
option cc_enable_arenas = true;
28+
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3";
29+
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3;cx";
30+
option java_multiple_files = true;
31+
option java_outer_classname = "DeploymentProto";
32+
option java_package = "com.google.cloud.dialogflow.cx.v3";
33+
option objc_class_prefix = "DF";
34+
option ruby_package = "Google::Cloud::Dialogflow::CX::V3";
35+
36+
// Service for managing [Deployments][google.cloud.dialogflow.cx.v3.Deployment].
37+
service Deployments {
38+
option (google.api.default_host) = "dialogflow.googleapis.com";
39+
option (google.api.oauth_scopes) =
40+
"https://www.googleapis.com/auth/cloud-platform,"
41+
"https://www.googleapis.com/auth/dialogflow";
42+
43+
// Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
44+
rpc ListDeployments(ListDeploymentsRequest) returns (ListDeploymentsResponse) {
45+
option (google.api.http) = {
46+
get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/deployments"
47+
};
48+
option (google.api.method_signature) = "parent";
49+
}
50+
51+
// Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].
52+
rpc GetDeployment(GetDeploymentRequest) returns (Deployment) {
53+
option (google.api.http) = {
54+
get: "/v3/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}"
55+
};
56+
option (google.api.method_signature) = "name";
57+
}
58+
}
59+
60+
// Represents an deployment in an environment. A deployment happens when a flow
61+
// version configured to be active in the environment. You can configure running
62+
// pre-deployment steps, e.g. running validation test cases, experiment
63+
// auto-rollout, etc.
64+
message Deployment {
65+
option (google.api.resource) = {
66+
type: "dialogflow.googleapis.com/Deployment"
67+
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}"
68+
};
69+
70+
// Result of the deployment.
71+
message Result {
72+
// Results of test cases running before the deployment.
73+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
74+
// ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>`.
75+
repeated string deployment_test_results = 1 [(google.api.resource_reference) = {
76+
type: "dialogflow.googleapis.com/TestCaseResult"
77+
}];
78+
79+
// The name of the experiment triggered by this deployment.
80+
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
81+
// ID>/environments/<Environment ID>/experiments/<Experiment ID>.
82+
string experiment = 2 [(google.api.resource_reference) = {
83+
type: "dialogflow.googleapis.com/Experiment"
84+
}];
85+
}
86+
87+
// The state of the deployment.
88+
enum State {
89+
// State unspecified.
90+
STATE_UNSPECIFIED = 0;
91+
92+
// The deployment is running.
93+
RUNNING = 1;
94+
95+
// The deployment succeeded.
96+
SUCCEEDED = 2;
97+
98+
// The deployment failed.
99+
FAILED = 3;
100+
}
101+
102+
// The name of the deployment.
103+
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
104+
// ID>/environments/<Environment ID>/deployments/<Deployment ID>.
105+
string name = 1;
106+
107+
// The name of the flow version for this deployment.
108+
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
109+
// ID>/flows/<Flow ID>/versions/<Verion ID>.
110+
string flow_version = 2 [(google.api.resource_reference) = {
111+
type: "dialogflow.googleapis.com/Version"
112+
}];
113+
114+
// The current state of the deployment.
115+
State state = 3;
116+
117+
// Result of the deployment.
118+
Result result = 4;
119+
120+
// Start time of this deployment.
121+
google.protobuf.Timestamp start_time = 5;
122+
123+
// End time of this deployment.
124+
google.protobuf.Timestamp end_time = 6;
125+
}
126+
127+
// The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments].
128+
message ListDeploymentsRequest {
129+
// Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for.
130+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
131+
// ID>/environments/<Environment ID>`.
132+
string parent = 1 [
133+
(google.api.field_behavior) = REQUIRED,
134+
(google.api.resource_reference) = {
135+
child_type: "dialogflow.googleapis.com/Deployment"
136+
}
137+
];
138+
139+
// The maximum number of items to return in a single page. By default 20 and
140+
// at most 100.
141+
int32 page_size = 2;
142+
143+
// The next_page_token value returned from a previous list request.
144+
string page_token = 3;
145+
}
146+
147+
// The response message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments].
148+
message ListDeploymentsResponse {
149+
// The list of deployments. There will be a maximum number of items
150+
// returned based on the page_size field in the request. The list may in some
151+
// cases be empty or contain fewer entries than page_size even if this isn't
152+
// the last page.
153+
repeated Deployment deployments = 1;
154+
155+
// Token to retrieve the next page of results, or empty if there are no more
156+
// results in the list.
157+
string next_page_token = 2;
158+
}
159+
160+
// The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3.Deployments.GetDeployment].
161+
message GetDeploymentRequest {
162+
// Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment].
163+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
164+
// ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
165+
string name = 1 [
166+
(google.api.field_behavior) = REQUIRED,
167+
(google.api.resource_reference) = {
168+
type: "dialogflow.googleapis.com/Deployment"
169+
}
170+
];
171+
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Dialogflow API
55

66
apis:
77
- name: google.cloud.dialogflow.cx.v3.Agents
8+
- name: google.cloud.dialogflow.cx.v3.Deployments
89
- name: google.cloud.dialogflow.cx.v3.EntityTypes
910
- name: google.cloud.dialogflow.cx.v3.Environments
1011
- name: google.cloud.dialogflow.cx.v3.Experiments
@@ -23,6 +24,8 @@ types:
2324
- name: google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata
2425
- name: google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse
2526
- name: google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata
27+
- name: google.cloud.dialogflow.cx.v3.DeployFlowMetadata
28+
- name: google.cloud.dialogflow.cx.v3.DeployFlowResponse
2629
- name: google.cloud.dialogflow.cx.v3.ExportAgentResponse
2730
- name: google.cloud.dialogflow.cx.v3.ExportFlowResponse
2831
- name: google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata
@@ -68,6 +71,10 @@ backend:
6871
rules:
6972
- selector: 'google.cloud.dialogflow.cx.v3.Agents.*'
7073
deadline: 60.0
74+
- selector: google.cloud.dialogflow.cx.v3.Deployments.GetDeployment
75+
deadline: 60.0
76+
- selector: google.cloud.dialogflow.cx.v3.Deployments.ListDeployments
77+
deadline: 60.0
7178
- selector: 'google.cloud.dialogflow.cx.v3.EntityTypes.*'
7279
deadline: 60.0
7380
- selector: 'google.cloud.dialogflow.cx.v3.Environments.*'
@@ -133,6 +140,16 @@ authentication:
133140
canonical_scopes: |-
134141
https://www.googleapis.com/auth/cloud-platform,
135142
https://www.googleapis.com/auth/dialogflow
143+
- selector: google.cloud.dialogflow.cx.v3.Deployments.GetDeployment
144+
oauth:
145+
canonical_scopes: |-
146+
https://www.googleapis.com/auth/cloud-platform,
147+
https://www.googleapis.com/auth/dialogflow
148+
- selector: google.cloud.dialogflow.cx.v3.Deployments.ListDeployments
149+
oauth:
150+
canonical_scopes: |-
151+
https://www.googleapis.com/auth/cloud-platform,
152+
https://www.googleapis.com/auth/dialogflow
136153
- selector: 'google.cloud.dialogflow.cx.v3.EntityTypes.*'
137154
oauth:
138155
canonical_scopes: |-

0 commit comments

Comments
 (0)