Skip to content

Commit 34ddf57

Browse files
feat: [dialogflow-cx] added Generator API (#4837)
* feat: add agent answer feedback capability feat: add fields for supporting barge-in in StreamingDetectIntent API feat: add end_user_metadata to QueryParameters feat: add boost & bury and filter ES controls PiperOrigin-RevId: 583522403 Source-Link: googleapis/googleapis@86c7ca6 Source-Link: googleapis/googleapis-gen@42f2c6e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6IjQyZjJjNmU5NzlhMWQyYTZmYWVkZDc3MmUyM2Q0OWU2ZWYwMTk0NzAifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add agent answer feedback capability feat: add fields for supporting barge-in in StreamingDetectIntent API feat: add end_user_metadata to QueryParameters feat: add boost & bury and filter ES controls PiperOrigin-RevId: 583523426 Source-Link: googleapis/googleapis@c73d0da Source-Link: googleapis/googleapis-gen@1b5ed29 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6IjFiNWVkMjk0OThiMzRlMTAxNmUxZjY5ZWNiMjgwODE2OGJkMzRkMTUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added Generator API docs: updated doc for speech model PiperOrigin-RevId: 586288282 Source-Link: googleapis/googleapis@17d36c4 Source-Link: googleapis/googleapis-gen@e2fb5ba Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6ImUyZmI1YmFiZmVjOTJmNzVmMTdmMzFmOTBiNjViYTVmZjNkNjkwOTUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added Generator API docs: updated doc for speech mode PiperOrigin-RevId: 586469693 Source-Link: googleapis/googleapis@e8148d6 Source-Link: googleapis/googleapis-gen@85136bd Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: sofisl <[email protected]>
1 parent 061e9a8 commit 34ddf57

144 files changed

Lines changed: 75697 additions & 37905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-dialogflow-cx/README.md

Lines changed: 12 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ message Agent {
245245
string engine = 1 [(google.api.field_behavior) = REQUIRED];
246246
}
247247

248+
// Settings for answer feedback collection.
249+
message AnswerFeedbackSettings {
250+
// Optional. If enabled, end users will be able to provide
251+
// [answer feedback][google.cloud.dialogflow.cx.v3.AnswerFeedback] to
252+
// Dialogflow responses. Feature works only if interaction logging is
253+
// enabled in the Dialogflow agent.
254+
bool enable_answer_feedback = 1 [(google.api.field_behavior) = OPTIONAL];
255+
}
256+
248257
// The unique identifier of the agent.
249258
// Required for the
250259
// [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]
@@ -335,6 +344,10 @@ message Agent {
335344

336345
// Gen App Builder-related agent-level settings.
337346
optional GenAppBuilderSettings gen_app_builder_settings = 33;
347+
348+
// Optional. Answer feedback collection settings.
349+
AnswerFeedbackSettings answer_feedback_settings = 38
350+
[(google.api.field_behavior) = OPTIONAL];
338351
}
339352

340353
// The request message for

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

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,39 @@ message SpeechWordInfo {
151151
float confidence = 4;
152152
}
153153

154+
// Configuration of the barge-in behavior. Barge-in instructs the API to return
155+
// a detected utterance at a proper time while the client is playing back the
156+
// response audio from a previous request. When the client sees the
157+
// utterance, it should stop the playback and immediately get ready for
158+
// receiving the responses for the current request.
159+
//
160+
// The barge-in handling requires the client to start streaming audio input
161+
// as soon as it starts playing back the audio from the previous response. The
162+
// playback is modeled into two phases:
163+
//
164+
// * No barge-in phase: which goes first and during which speech detection
165+
// should not be carried out.
166+
//
167+
// * Barge-in phase: which follows the no barge-in phase and during which
168+
// the API starts speech detection and may inform the client that an utterance
169+
// has been detected. Note that no-speech event is not expected in this
170+
// phase.
171+
//
172+
// The client provides this configuration in terms of the durations of those
173+
// two phases. The durations are measured in terms of the audio length from the
174+
// the start of the input audio.
175+
//
176+
// No-speech event is a response with END_OF_UTTERANCE without any transcript
177+
// following up.
178+
message BargeInConfig {
179+
// Duration that is not eligible for barge-in at the beginning of the input
180+
// audio.
181+
google.protobuf.Duration no_barge_in_duration = 1;
182+
183+
// Total duration for the playback at the beginning of the input audio.
184+
google.protobuf.Duration total_duration = 2;
185+
}
186+
154187
// Instructs the speech recognizer on how to process the audio content.
155188
message InputAudioConfig {
156189
// Required. Audio encoding of the audio content to process.
@@ -181,8 +214,8 @@ message InputAudioConfig {
181214

182215
// Optional. Which Speech model to select for the given request. Select the
183216
// model best suited to your domain to get best results. If a model is not
184-
// explicitly specified, then we auto-select a model based on the parameters
185-
// in the InputAudioConfig.
217+
// explicitly specified, then Dialogflow auto-selects a model based on other
218+
// parameters in the InputAudioConfig and Agent settings.
186219
// If enhanced speech model is enabled for the agent and an enhanced
187220
// version of the specified model for the language does not exist, then the
188221
// speech is recognized using the standard version of the specified model.
@@ -195,7 +228,12 @@ message InputAudioConfig {
195228
//
196229
// - phone_call (best for Agent Assist and telephony)
197230
// - latest_short (best for Dialogflow non-telephony)
198-
// - command_and_search (best for very short utterances and commands)
231+
// - command_and_search
232+
//
233+
// Leave this field unspecified to use
234+
// [Agent Speech
235+
// settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech)
236+
// for model selection.
199237
string model = 7;
200238

201239
// Optional. Which variant of the [Speech
@@ -211,6 +249,9 @@ message InputAudioConfig {
211249
// needed.
212250
// Note: This setting is relevant only for streaming methods.
213251
bool single_utterance = 8;
252+
253+
// Configuration of barge-in behavior during the streaming of input audio.
254+
BargeInConfig barge_in_config = 15;
214255
}
215256

216257
// Gender of the voice as described in

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@ service EntityTypes {
3939
"https://www.googleapis.com/auth/cloud-platform,"
4040
"https://www.googleapis.com/auth/dialogflow";
4141

42-
// Returns the list of all entity types in the specified agent.
43-
rpc ListEntityTypes(ListEntityTypesRequest)
44-
returns (ListEntityTypesResponse) {
45-
option (google.api.http) = {
46-
get: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes"
47-
};
48-
option (google.api.method_signature) = "parent";
49-
}
50-
5142
// Retrieves the specified entity type.
5243
rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) {
5344
option (google.api.http) = {
@@ -94,6 +85,15 @@ service EntityTypes {
9485
};
9586
option (google.api.method_signature) = "name";
9687
}
88+
89+
// Returns the list of all entity types in the specified agent.
90+
rpc ListEntityTypes(ListEntityTypesRequest)
91+
returns (ListEntityTypesResponse) {
92+
option (google.api.http) = {
93+
get: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes"
94+
};
95+
option (google.api.method_signature) = "parent";
96+
}
9797
}
9898

9999
// Entities are extracted from user input and represent parameters that are
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
// Copyright 2023 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+
26+
option cc_enable_arenas = true;
27+
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3";
28+
option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "GeneratorProto";
31+
option java_package = "com.google.cloud.dialogflow.cx.v3";
32+
option objc_class_prefix = "DF";
33+
34+
// Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator]
35+
service Generators {
36+
option (google.api.default_host) = "dialogflow.googleapis.com";
37+
option (google.api.oauth_scopes) =
38+
"https://www.googleapis.com/auth/cloud-platform,"
39+
"https://www.googleapis.com/auth/dialogflow";
40+
41+
// Returns the list of all generators in the specified agent.
42+
rpc ListGenerators(ListGeneratorsRequest) returns (ListGeneratorsResponse) {
43+
option (google.api.http) = {
44+
get: "/v3/{parent=projects/*/locations/*/agents/*}/generators"
45+
};
46+
option (google.api.method_signature) = "parent";
47+
}
48+
49+
// Retrieves the specified generator.
50+
rpc GetGenerator(GetGeneratorRequest) returns (Generator) {
51+
option (google.api.http) = {
52+
get: "/v3/{name=projects/*/locations/*/agents/*/generators/*}"
53+
};
54+
option (google.api.method_signature) = "name";
55+
}
56+
57+
// Creates a generator in the specified agent.
58+
rpc CreateGenerator(CreateGeneratorRequest) returns (Generator) {
59+
option (google.api.http) = {
60+
post: "/v3/{parent=projects/*/locations/*/agents/*}/generators"
61+
body: "generator"
62+
};
63+
option (google.api.method_signature) = "parent,generator";
64+
}
65+
66+
// Update the specified generator.
67+
rpc UpdateGenerator(UpdateGeneratorRequest) returns (Generator) {
68+
option (google.api.http) = {
69+
patch: "/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}"
70+
body: "generator"
71+
};
72+
option (google.api.method_signature) = "generator,update_mask";
73+
}
74+
75+
// Deletes the specified generators.
76+
rpc DeleteGenerator(DeleteGeneratorRequest) returns (google.protobuf.Empty) {
77+
option (google.api.http) = {
78+
delete: "/v3/{name=projects/*/locations/*/agents/*/generators/*}"
79+
};
80+
option (google.api.method_signature) = "name";
81+
}
82+
}
83+
84+
// Generators contain prompt to be sent to the LLM model to generate text. The
85+
// prompt can contain parameters which will be resolved before calling the
86+
// model. It can optionally contain banned phrases to ensure the model responses
87+
// are safe.
88+
message Generator {
89+
option (google.api.resource) = {
90+
type: "dialogflow.googleapis.com/Generator"
91+
pattern: "projects/{project}/locations/{location}/agents/{agent}/generators/{generator}"
92+
};
93+
94+
// Represents a custom placeholder in the prompt text.
95+
message Placeholder {
96+
// Unique ID used to map custom placeholder to parameters in fulfillment.
97+
string id = 1;
98+
99+
// Custom placeholder value in the prompt text.
100+
string name = 2;
101+
}
102+
103+
// The unique identifier of the generator.
104+
// Must be set for the
105+
// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator]
106+
// method. [Generators.CreateGenerate][] populates the name automatically.
107+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
108+
// ID>/generators/<Generator ID>`.
109+
string name = 1;
110+
111+
// Required. The human-readable name of the generator, unique within the
112+
// agent. The prompt contains pre-defined parameters such as $conversation,
113+
// $last-user-utterance, etc. populated by Dialogflow. It can also contain
114+
// custom placeholders which will be resolved during fulfillment.
115+
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
116+
117+
// Required. Prompt for the LLM model.
118+
Phrase prompt_text = 3 [(google.api.field_behavior) = REQUIRED];
119+
120+
// Optional. List of custom placeholders in the prompt text.
121+
repeated Placeholder placeholders = 5
122+
[(google.api.field_behavior) = OPTIONAL];
123+
}
124+
125+
// Text input which can be used for prompt or banned phrases.
126+
message Phrase {
127+
// Required. Text input which can be used for prompt or banned phrases.
128+
string text = 1 [(google.api.field_behavior) = REQUIRED];
129+
}
130+
131+
// The request message for
132+
// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators].
133+
message ListGeneratorsRequest {
134+
// Required. The agent to list all generators for.
135+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
136+
string parent = 1 [
137+
(google.api.field_behavior) = REQUIRED,
138+
(google.api.resource_reference) = {
139+
child_type: "dialogflow.googleapis.com/Generator"
140+
}
141+
];
142+
143+
// The language to list generators for.
144+
string language_code = 2;
145+
146+
// The maximum number of items to return in a single page. By default 100 and
147+
// at most 1000.
148+
int32 page_size = 3;
149+
150+
// The next_page_token value returned from a previous list request.
151+
string page_token = 4;
152+
}
153+
154+
// The response message for
155+
// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3.Generators.ListGenerators].
156+
message ListGeneratorsResponse {
157+
// The list of generators. There will be a maximum number of items returned
158+
// based on the page_size field in the request.
159+
repeated Generator generators = 1;
160+
161+
// Token to retrieve the next page of results, or empty if there are no more
162+
// results in the list.
163+
string next_page_token = 2;
164+
}
165+
166+
// The request message for
167+
// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3.Generators.GetGenerator].
168+
message GetGeneratorRequest {
169+
// Required. The name of the generator.
170+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
171+
// ID>/generators/<Generator ID>`.
172+
string name = 1 [
173+
(google.api.field_behavior) = REQUIRED,
174+
(google.api.resource_reference) = {
175+
type: "dialogflow.googleapis.com/Generator"
176+
}
177+
];
178+
179+
// The language to list generators for.
180+
string language_code = 2;
181+
}
182+
183+
// The request message for
184+
// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3.Generators.CreateGenerator].
185+
message CreateGeneratorRequest {
186+
// Required. The agent to create a generator for.
187+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
188+
string parent = 1 [
189+
(google.api.field_behavior) = REQUIRED,
190+
(google.api.resource_reference) = {
191+
child_type: "dialogflow.googleapis.com/Generator"
192+
}
193+
];
194+
195+
// Required. The generator to create.
196+
Generator generator = 2 [(google.api.field_behavior) = REQUIRED];
197+
198+
// The language to create generators for the following fields:
199+
// * `Generator.prompt_text.text`
200+
// If not specified, the agent's default language is used.
201+
string language_code = 3;
202+
}
203+
204+
// The request message for
205+
// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3.Generators.UpdateGenerator].
206+
message UpdateGeneratorRequest {
207+
// Required. The generator to update.
208+
Generator generator = 1 [(google.api.field_behavior) = REQUIRED];
209+
210+
// The language to list generators for.
211+
string language_code = 2;
212+
213+
// The mask to control which fields get updated. If the mask is not present,
214+
// all fields will be updated.
215+
google.protobuf.FieldMask update_mask = 3;
216+
}
217+
218+
// The request message for
219+
// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3.Generators.DeleteGenerator].
220+
message DeleteGeneratorRequest {
221+
// Required. The name of the generator to delete.
222+
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
223+
// ID>/generators/<Generator ID>`.
224+
string name = 1 [
225+
(google.api.field_behavior) = REQUIRED,
226+
(google.api.resource_reference) = {
227+
type: "dialogflow.googleapis.com/Generator"
228+
}
229+
];
230+
231+
// This field has no effect for generators not being used.
232+
// For generators that are used by pages/flows/transition route groups:
233+
//
234+
// * If `force` is set to false, an error will be returned with message
235+
// indicating the referenced resources.
236+
// * If `force` is set to true, Dialogflow will remove the generator, as well
237+
// as any references to the generator (i.e.
238+
// [Generator][Fulfillment.generator]) in fulfillments.
239+
bool force = 2;
240+
}

0 commit comments

Comments
 (0)