Skip to content

Commit dcbd1d4

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add Proactive Generative Knowledge Assist endpoints and types
feat: Add Generator related services and types feat: Add GenerateStatelessSuggestion related endpoints and types docs: A comment for field `name` in message `.google.cloud.dialogflow.v2.Conversation` is changed docs: A comment for field `conversation_stage` in message `.google.cloud.dialogflow.v2.Conversation` is changed docs: A comment for field `filter` in message `.google.cloud.dialogflow.v2.ListConversationsRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `context_size` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `assist_query_params` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest` is changed docs: A comment for field `max_context_size` in message `.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest` is changed docs: A comment for field `parent` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `session_id` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `conversation` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for message `HumanAgentHandoffConfig` is changed docs: A comment for field `live_person_config` in message `.google.cloud.dialogflow.v2.HumanAgentHandoffConfig` is changed docs: A comment for field `audio` in message `.google.cloud.dialogflow.v2.AudioInput` is changed fix: Changed field behavior for an existing field `parent` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` fix: Changed field behavior for an existing field `session_id` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` PiperOrigin-RevId: 658854047
1 parent a1cc0b4 commit dcbd1d4

9 files changed

Lines changed: 906 additions & 48 deletions

google/cloud/dialogflow/v2/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ proto_library(
3434
"conversation_model.proto",
3535
"conversation_profile.proto",
3636
"document.proto",
37+
"encryption_spec.proto",
3738
"entity_type.proto",
3839
"environment.proto",
3940
"fulfillment.proto",
4041
"gcs.proto",
42+
"generator.proto",
4143
"human_agent_assistant_event.proto",
4244
"intent.proto",
4345
"knowledge_base.proto",
@@ -135,12 +137,16 @@ java_gapic_test(
135137
"com.google.cloud.dialogflow.v2.ConversationsClientTest",
136138
"com.google.cloud.dialogflow.v2.DocumentsClientHttpJsonTest",
137139
"com.google.cloud.dialogflow.v2.DocumentsClientTest",
140+
"com.google.cloud.dialogflow.v2.EncryptionSpecServiceClientHttpJsonTest",
141+
"com.google.cloud.dialogflow.v2.EncryptionSpecServiceClientTest",
138142
"com.google.cloud.dialogflow.v2.EntityTypesClientHttpJsonTest",
139143
"com.google.cloud.dialogflow.v2.EntityTypesClientTest",
140144
"com.google.cloud.dialogflow.v2.EnvironmentsClientHttpJsonTest",
141145
"com.google.cloud.dialogflow.v2.EnvironmentsClientTest",
142146
"com.google.cloud.dialogflow.v2.FulfillmentsClientHttpJsonTest",
143147
"com.google.cloud.dialogflow.v2.FulfillmentsClientTest",
148+
"com.google.cloud.dialogflow.v2.GeneratorsClientHttpJsonTest",
149+
"com.google.cloud.dialogflow.v2.GeneratorsClientTest",
144150
"com.google.cloud.dialogflow.v2.IntentsClientHttpJsonTest",
145151
"com.google.cloud.dialogflow.v2.IntentsClientTest",
146152
"com.google.cloud.dialogflow.v2.KnowledgeBasesClientHttpJsonTest",
@@ -406,6 +412,7 @@ load(
406412

407413
csharp_proto_library(
408414
name = "dialogflow_csharp_proto",
415+
extra_opts = [],
409416
deps = [":dialogflow_proto"],
410417
)
411418

google/cloud/dialogflow/v2/answer_record.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,22 @@ message AgentAssistantFeedback {
293293
repeated string clicked_uris = 2;
294294
}
295295

296+
// Feedback for knowledge assist.
297+
message KnowledgeAssistFeedback {
298+
// Whether the suggested answer was copied by the human agent.
299+
// If the value is set to be true,
300+
// [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked]
301+
// will be updated to be true.
302+
bool answer_copied = 1;
303+
304+
// The URIs clicked by the human agent. The value is appended for each
305+
// UpdateAnswerRecordRequest.
306+
// If the value is not empty,
307+
// [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked]
308+
// will be updated to be true.
309+
repeated string clicked_uris = 2;
310+
}
311+
296312
// Optional. Whether or not the suggested answer is relevant.
297313
//
298314
// For example:
@@ -331,6 +347,10 @@ message AgentAssistantFeedback {
331347
// Optional. Feedback for knowledge search.
332348
KnowledgeSearchFeedback knowledge_search_feedback = 5
333349
[(google.api.field_behavior) = OPTIONAL];
350+
351+
// Optional. Feedback for knowledge assist.
352+
KnowledgeAssistFeedback knowledge_assist_feedback = 6
353+
[(google.api.field_behavior) = OPTIONAL];
334354
}
335355

336356
// Represents a record of a human agent assist answer.

google/cloud/dialogflow/v2/audio_config.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,30 @@ message SpeechToTextConfig {
287287
// for model selection.
288288
string model = 2;
289289

290+
// Audio encoding of the audio content to process.
291+
AudioEncoding audio_encoding = 6;
292+
293+
// Sample rate (in Hertz) of the audio content sent in the query.
294+
// Refer to [Cloud Speech API
295+
// documentation](https://cloud.google.com/speech-to-text/docs/basics) for
296+
// more details.
297+
int32 sample_rate_hertz = 7;
298+
299+
// The language of the supplied audio. Dialogflow does not do
300+
// translations. See [Language
301+
// Support](https://cloud.google.com/dialogflow/docs/reference/language)
302+
// for a list of the currently supported language codes. Note that queries in
303+
// the same session do not necessarily need to specify the same language.
304+
string language_code = 8;
305+
306+
// If `true`, Dialogflow returns
307+
// [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in
308+
// [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult]
309+
// with information about the recognized speech words, e.g. start and end time
310+
// offsets. If false or unspecified, Speech doesn't return any word-level
311+
// information.
312+
bool enable_word_info = 9;
313+
290314
// Use timeout based endpointing, interpreting endpointer sensitivy as
291315
// seconds of timeout value.
292316
bool use_timeout_based_endpointing = 11;

google/cloud/dialogflow/v2/conversation.proto

Lines changed: 109 additions & 46 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/v2/conversation_profile.proto";
24+
import "google/cloud/dialogflow/v2/generator.proto";
2425
import "google/cloud/dialogflow/v2/participant.proto";
2526
import "google/cloud/dialogflow/v2/session.proto";
2627
import "google/protobuf/timestamp.proto";
@@ -156,6 +157,16 @@ service Conversations {
156157
};
157158
}
158159

160+
// Generates and returns a suggestion for a conversation that does not have a
161+
// resource created for it.
162+
rpc GenerateStatelessSuggestion(GenerateStatelessSuggestionRequest)
163+
returns (GenerateStatelessSuggestionResponse) {
164+
option (google.api.http) = {
165+
post: "/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate"
166+
body: "*"
167+
};
168+
}
169+
159170
// Get answers for the given query based on knowledge documents.
160171
rpc SearchKnowledge(SearchKnowledgeRequest)
161172
returns (SearchKnowledgeResponse) {
@@ -187,6 +198,8 @@ message Conversation {
187198
type: "dialogflow.googleapis.com/Conversation"
188199
pattern: "projects/{project}/conversations/{conversation}"
189200
pattern: "projects/{project}/locations/{location}/conversations/{conversation}"
201+
plural: "conversations"
202+
singular: "conversation"
190203
};
191204

192205
// Enumeration of the completion status of the conversation.
@@ -218,10 +231,13 @@ message Conversation {
218231
HUMAN_ASSIST_STAGE = 2;
219232
}
220233

221-
// Output only. The unique identifier of this conversation.
234+
// Output only. Identifier. The unique identifier of this conversation.
222235
// Format: `projects/<Project ID>/locations/<Location
223236
// ID>/conversations/<Conversation ID>`.
224-
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
237+
string name = 1 [
238+
(google.api.field_behavior) = OUTPUT_ONLY,
239+
(google.api.field_behavior) = IDENTIFIER
240+
];
225241

226242
// Output only. The current state of the Conversation.
227243
LifecycleState lifecycle_state = 2
@@ -251,8 +267,8 @@ message Conversation {
251267
google.protobuf.Timestamp end_time = 6
252268
[(google.api.field_behavior) = OUTPUT_ONLY];
253269

254-
// The stage of a conversation. It indicates whether the virtual agent or a
255-
// human agent is handling the conversation.
270+
// Optional. The stage of a conversation. It indicates whether the virtual
271+
// agent or a human agent is handling the conversation.
256272
//
257273
// If the conversation is created with the conversation profile that has
258274
// Dialogflow config set, defaults to
@@ -267,7 +283,8 @@ message Conversation {
267283
// [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]
268284
// stage and directly goes to
269285
// [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE].
270-
ConversationStage conversation_stage = 7;
286+
ConversationStage conversation_stage = 7
287+
[(google.api.field_behavior) = OPTIONAL];
271288
}
272289

273290
// The request message for
@@ -317,24 +334,15 @@ message ListConversationsRequest {
317334
// Optional. The next_page_token value returned from a previous list request.
318335
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
319336

320-
// A filter expression that filters conversations listed in the response. In
321-
// general, the expression must specify the field name, a comparison operator,
322-
// and the value to use for filtering:
323-
// <ul>
324-
// <li>The value must be a string, a number, or a boolean.</li>
325-
// <li>The comparison operator must be either `=`,`!=`, `>`, or `<`.</li>
326-
// <li>To filter on multiple expressions, separate the
327-
// expressions with `AND` or `OR` (omitting both implies `AND`).</li>
328-
// <li>For clarity, expressions can be enclosed in parentheses.</li>
329-
// </ul>
330-
// Only `lifecycle_state` can be filtered on in this way. For example,
331-
// the following expression only returns `COMPLETED` conversations:
337+
// Optional. A filter expression that filters conversations listed in the
338+
// response. Only `lifecycle_state` can be filtered on in this way. For
339+
// example, the following expression only returns `COMPLETED` conversations:
332340
//
333341
// `lifecycle_state = "COMPLETED"`
334342
//
335343
// For more information about filtering, see
336344
// [API Filtering](https://aip.dev/160).
337-
string filter = 4;
345+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
338346
}
339347

340348
// The response message for
@@ -441,23 +449,28 @@ message SuggestConversationSummaryRequest {
441449
}
442450
];
443451

444-
// The name of the latest conversation message used as context for
452+
// Optional. The name of the latest conversation message used as context for
445453
// compiling suggestion. If empty, the latest message of the conversation will
446454
// be used.
447455
//
448456
// Format: `projects/<Project ID>/locations/<Location
449457
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
450-
string latest_message = 3 [(google.api.resource_reference) = {
451-
type: "dialogflow.googleapis.com/Message"
452-
}];
458+
string latest_message = 3 [
459+
(google.api.field_behavior) = OPTIONAL,
460+
(google.api.resource_reference) = {
461+
type: "dialogflow.googleapis.com/Message"
462+
}
463+
];
453464

454-
// Max number of messages prior to and including
465+
// Optional. Max number of messages prior to and including
455466
// [latest_message] to use as context when compiling the
456467
// suggestion. By default 500 and at most 1000.
457-
int32 context_size = 4;
468+
int32 context_size = 4 [(google.api.field_behavior) = OPTIONAL];
458469

459-
// Parameters for a human assist query. Only used for POC/demo purpose.
460-
AssistQueryParameters assist_query_params = 5;
470+
// Optional. Parameters for a human assist query. Only used for POC/demo
471+
// purpose.
472+
AssistQueryParameters assist_query_params = 5
473+
[(google.api.field_behavior) = OPTIONAL];
461474
}
462475

463476
// The response message for
@@ -537,18 +550,21 @@ message GenerateStatelessSummaryRequest {
537550
ConversationProfile conversation_profile = 2
538551
[(google.api.field_behavior) = REQUIRED];
539552

540-
// The name of the latest conversation message used as context for
553+
// Optional. The name of the latest conversation message used as context for
541554
// generating a Summary. If empty, the latest message of the conversation will
542555
// be used. The format is specific to the user and the names of the messages
543556
// provided.
544-
string latest_message = 3 [(google.api.resource_reference) = {
545-
type: "dialogflow.googleapis.com/Message"
546-
}];
557+
string latest_message = 3 [
558+
(google.api.field_behavior) = OPTIONAL,
559+
(google.api.resource_reference) = {
560+
type: "dialogflow.googleapis.com/Message"
561+
}
562+
];
547563

548-
// Max number of messages prior to and including
564+
// Optional. Max number of messages prior to and including
549565
// [latest_message] to use as context when compiling the
550566
// suggestion. By default 500 and at most 1000.
551-
int32 max_context_size = 4;
567+
int32 max_context_size = 4 [(google.api.field_behavior) = OPTIONAL];
552568
}
553569

554570
// The response message for
@@ -586,13 +602,54 @@ message GenerateStatelessSummaryResponse {
586602
int32 context_size = 3;
587603
}
588604

605+
// The request message for
606+
// [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
607+
message GenerateStatelessSuggestionRequest {
608+
// Required. The parent resource to charge for the Suggestion's generation.
609+
// Format: `projects/<Project ID>/locations/<Location ID>`.
610+
string parent = 1 [
611+
(google.api.field_behavior) = REQUIRED,
612+
(google.api.resource_reference) = {
613+
type: "locations.googleapis.com/Location"
614+
}
615+
];
616+
617+
// Generator.
618+
oneof generator_resource {
619+
// Uncreated generator. It should be a complete generator that includes all
620+
// information about the generator.
621+
Generator generator = 2;
622+
623+
// The resource name of the existing created generator. Format:
624+
// `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
625+
string generator_name = 3;
626+
}
627+
628+
// Optional. Context of the conversation, including transcripts.
629+
ConversationContext conversation_context = 5
630+
[(google.api.field_behavior) = OPTIONAL];
631+
632+
// Optional. A list of trigger events. Generator will be triggered only if
633+
// it's trigger event is included here.
634+
repeated TriggerEvent trigger_events = 6
635+
[(google.api.field_behavior) = OPTIONAL];
636+
}
637+
638+
// The response message for
639+
// [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
640+
message GenerateStatelessSuggestionResponse {
641+
// Required. Generated suggestion for a conversation.
642+
GeneratorSuggestion generator_suggestion = 1
643+
[(google.api.field_behavior) = REQUIRED];
644+
}
645+
589646
// The request message for
590647
// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2.Conversations.SearchKnowledge].
591648
message SearchKnowledgeRequest {
592-
// The parent resource contains the conversation profile
649+
// Required. The parent resource contains the conversation profile
593650
// Format: 'projects/<Project ID>' or `projects/<Project
594651
// ID>/locations/<Location ID>`.
595-
string parent = 6;
652+
string parent = 6 [(google.api.field_behavior) = REQUIRED];
596653

597654
// Required. The natural language text query for knowledge search.
598655
TextInput query = 1 [(google.api.field_behavior) = REQUIRED];
@@ -607,29 +664,35 @@ message SearchKnowledgeRequest {
607664
}
608665
];
609666

610-
// The ID of the search session.
667+
// Required. The ID of the search session.
611668
// The session_id can be combined with Dialogflow V3 Agent ID retrieved from
612669
// conversation profile or on its own to identify a search session. The search
613670
// history of the same session will impact the search result. It's up to the
614671
// API caller to choose an appropriate `Session ID`. It can be a random number
615672
// or some type of session identifiers (preferably hashed). The length must
616673
// not exceed 36 characters.
617-
string session_id = 3;
674+
string session_id = 3 [(google.api.field_behavior) = REQUIRED];
618675

619-
// The conversation (between human agent and end user) where the search
620-
// request is triggered. Format: `projects/<Project ID>/locations/<Location
621-
// ID>/conversations/<Conversation ID>`.
622-
string conversation = 4 [(google.api.resource_reference) = {
623-
type: "dialogflow.googleapis.com/Conversation"
624-
}];
676+
// Optional. The conversation (between human agent and end user) where the
677+
// search request is triggered. Format: `projects/<Project
678+
// ID>/locations/<Location ID>/conversations/<Conversation ID>`.
679+
string conversation = 4 [
680+
(google.api.field_behavior) = OPTIONAL,
681+
(google.api.resource_reference) = {
682+
type: "dialogflow.googleapis.com/Conversation"
683+
}
684+
];
625685

626-
// The name of the latest conversation message when the request is
686+
// Optional. The name of the latest conversation message when the request is
627687
// triggered.
628688
// Format: `projects/<Project ID>/locations/<Location
629689
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
630-
string latest_message = 5 [(google.api.resource_reference) = {
631-
type: "dialogflow.googleapis.com/Message"
632-
}];
690+
string latest_message = 5 [
691+
(google.api.field_behavior) = OPTIONAL,
692+
(google.api.resource_reference) = {
693+
type: "dialogflow.googleapis.com/Message"
694+
}
695+
];
633696
}
634697

635698
// The response message for

0 commit comments

Comments
 (0)