Skip to content

Commit 1738e25

Browse files
feat: mark agent.default_language_code as required feat: add return_partial response to Fulfillment docs: add notes to train agent before sending queries (#140)
PiperOrigin-RevId: 380726996
1 parent 81936f2 commit 1738e25

18 files changed

+391
-10
lines changed

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/agent.proto

+18-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ service Agents {
5858
}
5959

6060
// Creates an agent in the specified location.
61+
//
62+
// Note: You should always train flows prior to sending them queries. See the
63+
// [training
64+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6165
rpc CreateAgent(CreateAgentRequest) returns (Agent) {
6266
option (google.api.http) = {
6367
post: "/v3/{parent=projects/*/locations/*}/agents"
@@ -67,6 +71,10 @@ service Agents {
6771
}
6872

6973
// Updates the specified agent.
74+
//
75+
// Note: You should always train flows prior to sending them queries. See the
76+
// [training
77+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7078
rpc UpdateAgent(UpdateAgentRequest) returns (Agent) {
7179
option (google.api.http) = {
7280
patch: "/v3/{agent.name=projects/*/locations/*/agents/*}"
@@ -99,6 +107,11 @@ service Agents {
99107
//
100108
// Replaces the current agent with a new one. Note that all existing resources
101109
// in agent (e.g. intents, entity types, flows) will be removed.
110+
//
111+
//
112+
// Note: You should always train flows prior to sending them queries. See the
113+
// [training
114+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
102115
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
103116
option (google.api.http) = {
104117
post: "/v3/{name=projects/*/locations/*/agents/*}:restore"
@@ -159,12 +172,15 @@ message Agent {
159172
// Required. The human-readable name of the agent, unique within the location.
160173
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
161174

162-
// Immutable. The default language of the agent as a language tag.
175+
// Required. Immutable. The default language of the agent as a language tag.
163176
// See [Language
164177
// Support](https://cloud.google.com/dialogflow/cx/docs/reference/language)
165178
// for a list of the currently supported language codes.
166179
// This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] method.
167-
string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE];
180+
string default_language_code = 3 [
181+
(google.api.field_behavior) = REQUIRED,
182+
(google.api.field_behavior) = IMMUTABLE
183+
];
168184

169185
// The list of all languages supported by the agent (except for the
170186
// `default_language_code`).

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/entity_type.proto

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ service EntityTypes {
5555
}
5656

5757
// Creates an entity type in the specified agent.
58+
//
59+
// Note: You should always train a flow prior to sending it queries. See the
60+
// [training
61+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
5862
rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) {
5963
option (google.api.http) = {
6064
post: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes"
@@ -64,6 +68,10 @@ service EntityTypes {
6468
}
6569

6670
// Updates the specified entity type.
71+
//
72+
// Note: You should always train a flow prior to sending it queries. See the
73+
// [training
74+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6775
rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) {
6876
option (google.api.http) = {
6977
patch: "/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}"
@@ -73,6 +81,10 @@ service EntityTypes {
7381
}
7482

7583
// Deletes the specified entity type.
84+
//
85+
// Note: You should always train a flow prior to sending it queries. See the
86+
// [training
87+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7688
rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) {
7789
option (google.api.http) = {
7890
delete: "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}"

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/flow.proto

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ service Flows {
4343
"https://www.googleapis.com/auth/dialogflow";
4444

4545
// Creates a flow in the specified agent.
46+
//
47+
// Note: You should always train a flow prior to sending it queries. See the
48+
// [training
49+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
4650
rpc CreateFlow(CreateFlowRequest) returns (Flow) {
4751
option (google.api.http) = {
4852
post: "/v3/{parent=projects/*/locations/*/agents/*}/flows"
@@ -76,6 +80,10 @@ service Flows {
7680
}
7781

7882
// Updates the specified flow.
83+
//
84+
// Note: You should always train a flow prior to sending it queries. See the
85+
// [training
86+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7987
rpc UpdateFlow(UpdateFlowRequest) returns (Flow) {
8088
option (google.api.http) = {
8189
patch: "/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}"
@@ -86,6 +94,10 @@ service Flows {
8694

8795
// Trains the specified flow. Note that only the flow in 'draft' environment
8896
// is trained.
97+
//
98+
// Note: You should always train a flow prior to sending it queries. See the
99+
// [training
100+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
89101
rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) {
90102
option (google.api.http) = {
91103
post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:train"
@@ -118,6 +130,10 @@ service Flows {
118130
}
119131

120132
// Imports the specified flow to the specified agent from a binary file.
133+
//
134+
// Note: You should always train a flow prior to sending it queries. See the
135+
// [training
136+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
121137
rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) {
122138
option (google.api.http) = {
123139
post: "/v3/{parent=projects/*/locations/*/agents/*}/flows:import"

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto

+11
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ message Fulfillment {
9595
type: "dialogflow.googleapis.com/Webhook"
9696
}];
9797

98+
// Whether Dialogflow should return currently queued fulfillment response
99+
// messages in streaming APIs. If a webhook is specified, it happens before
100+
// Dialogflow invokes webhook.
101+
// Warning:
102+
// 1) This flag only affects streaming API. Responses are still queued
103+
// and returned once in non-streaming API.
104+
// 2) The flag can be enabled in any fulfillment but only the first 3 partial
105+
// responses will be returned. You may only want to apply it to fulfillments
106+
// that have slow webhooks.
107+
bool return_partial_responses = 8;
108+
98109
// The tag used by the webhook to identify which fulfillment is being called.
99110
// This field is required if `webhook` is specified.
100111
string tag = 3;

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/intent.proto

+17-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/protobuf/empty.proto";
2424
import "google/protobuf/field_mask.proto";
25+
import "google/protobuf/timestamp.proto";
2526

2627
option cc_enable_arenas = true;
2728
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3";
@@ -55,6 +56,10 @@ service Intents {
5556
}
5657

5758
// Creates an intent in the specified agent.
59+
//
60+
// Note: You should always train a flow prior to sending it queries. See the
61+
// [training
62+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
5863
rpc CreateIntent(CreateIntentRequest) returns (Intent) {
5964
option (google.api.http) = {
6065
post: "/v3/{parent=projects/*/locations/*/agents/*}/intents"
@@ -64,6 +69,10 @@ service Intents {
6469
}
6570

6671
// Updates the specified intent.
72+
//
73+
// Note: You should always train a flow prior to sending it queries. See the
74+
// [training
75+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6776
rpc UpdateIntent(UpdateIntentRequest) returns (Intent) {
6877
option (google.api.http) = {
6978
patch: "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}"
@@ -73,6 +82,10 @@ service Intents {
7382
}
7483

7584
// Deletes the specified intent.
85+
//
86+
// Note: You should always train a flow prior to sending it queries. See the
87+
// [training
88+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7689
rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) {
7790
option (google.api.http) = {
7891
delete: "/v3/{name=projects/*/locations/*/agents/*/intents/*}"
@@ -205,11 +218,11 @@ message Intent {
205218
// start with a letter. Keys and values can be no longer than 63 characters
206219
// and no more than 128 bytes.
207220
//
208-
// Prefix "sys." is reserved for Dialogflow defined labels. Currently allowed
221+
// Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed
209222
// Dialogflow defined labels include:
210-
// * sys.head
211-
// * sys.contextual
212-
// The above labels do not require value. "sys.head" means the intent is a
223+
// * sys-head
224+
// * sys-contextual
225+
// The above labels do not require value. "sys-head" means the intent is a
213226
// head intent. "sys.contextual" means the intent is a contextual intent.
214227
map<string, string> labels = 7;
215228

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/page.proto

+12
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ service Pages {
5757
}
5858

5959
// Creates a page in the specified flow.
60+
//
61+
// Note: You should always train a flow prior to sending it queries. See the
62+
// [training
63+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6064
rpc CreatePage(CreatePageRequest) returns (Page) {
6165
option (google.api.http) = {
6266
post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages"
@@ -66,6 +70,10 @@ service Pages {
6670
}
6771

6872
// Updates the specified page.
73+
//
74+
// Note: You should always train a flow prior to sending it queries. See the
75+
// [training
76+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6977
rpc UpdatePage(UpdatePageRequest) returns (Page) {
7078
option (google.api.http) = {
7179
patch: "/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}"
@@ -75,6 +83,10 @@ service Pages {
7583
}
7684

7785
// Deletes the specified page.
86+
//
87+
// Note: You should always train a flow prior to sending it queries. See the
88+
// [training
89+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7890
rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) {
7991
option (google.api.http) = {
8092
delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}"

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/security_settings.proto

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ message SecuritySettings {
226226
// If empty, we use the default DLP inspect config.
227227
//
228228
// The template name will have one of the following formats:
229-
// `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR
230-
// `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`
229+
// `projects/<Project ID>/inspectTemplates/<Template ID>` OR
230+
// `projects/<Project ID>/locations/<Location ID>/inspectTemplates/<Template
231+
// ID>` OR
232+
// `organizations/<Organization ID>/inspectTemplates/<Template ID>`
231233
string inspect_template = 9;
232234

233235
// Specifies how data is retained. Note that even if the data is

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/session.proto

+31-2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ message DetectIntentRequest {
147147

148148
// The message returned from the DetectIntent method.
149149
message DetectIntentResponse {
150+
// Represents different DetectIntentResponse types.
151+
enum ResponseType {
152+
// Not specified. This should never happen.
153+
RESPONSE_TYPE_UNSPECIFIED = 0;
154+
155+
// Partial response. e.g. Aggregated responses in a Fulfillment that enables
156+
// `return_partial_response` can be returned as partial response.
157+
// WARNING: partial response is not eligible for barge-in.
158+
PARTIAL = 1;
159+
160+
// Final response.
161+
FINAL = 2;
162+
}
163+
150164
// Output only. The unique identifier of the response. It can be used to
151165
// locate a response in the training example set or for reporting issues.
152166
string response_id = 1;
@@ -169,6 +183,14 @@ message DetectIntentResponse {
169183

170184
// The config used by the speech synthesizer to generate the output audio.
171185
OutputAudioConfig output_audio_config = 5;
186+
187+
// Response type.
188+
ResponseType response_type = 6;
189+
190+
// Indicates whether the partial response can be cancelled when a later
191+
// response arrives. e.g. if the agent specified some music as partial
192+
// response, it can be cancelled.
193+
bool allow_cancellation = 7;
172194
}
173195

174196
// The top-level message sent by the client to the
@@ -229,6 +251,12 @@ message StreamingDetectIntentRequest {
229251

230252
// Instructs the speech synthesizer how to generate the output audio.
231253
OutputAudioConfig output_audio_config = 4;
254+
255+
// Enable partial detect intent response. If this flag is not enabled,
256+
// response stream still contains only one final `DetectIntentResponse` even
257+
// if some `Fulfillment`s in the agent have been configured to return partial
258+
// responses.
259+
bool enable_partial_response = 5;
232260
}
233261

234262
// The top-level message returned from the `StreamingDetectIntent` method.
@@ -408,8 +436,9 @@ message QueryParameters {
408436
google.protobuf.Struct parameters = 5;
409437

410438
// The unique identifier of the [page][google.cloud.dialogflow.cx.v3.Page] to override the [current
411-
// page][QueryResult.current_page] in the session. Format: `projects/<Project
412-
// ID>/locations/<Location ID>/agents/<Agent ID>/pages/<page ID>`.
439+
// page][QueryResult.current_page] in the session.
440+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
441+
// ID>/flows/<Flow ID>/pages/<Page ID>`.
413442
//
414443
// If `current_page` is specified, the previous state of the session will be
415444
// ignored by Dialogflow, including the [previous

packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto

+12
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ service TransitionRouteGroups {
5656
}
5757

5858
// Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
59+
//
60+
// Note: You should always train a flow prior to sending it queries. See the
61+
// [training
62+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
5963
rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) returns (TransitionRouteGroup) {
6064
option (google.api.http) = {
6165
post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups"
@@ -65,6 +69,10 @@ service TransitionRouteGroups {
6569
}
6670

6771
// Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
72+
//
73+
// Note: You should always train a flow prior to sending it queries. See the
74+
// [training
75+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
6876
rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) returns (TransitionRouteGroup) {
6977
option (google.api.http) = {
7078
patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}"
@@ -74,6 +82,10 @@ service TransitionRouteGroups {
7482
}
7583

7684
// Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
85+
//
86+
// Note: You should always train a flow prior to sending it queries. See the
87+
// [training
88+
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
7789
rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) returns (google.protobuf.Empty) {
7890
option (google.api.http) = {
7991
delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}"

0 commit comments

Comments
 (0)