Skip to content

Commit b1666e6

Browse files
Google APIscopybara-github
authored andcommitted
feat: added speech endpointing setting
feat: added Knowledge Search API PiperOrigin-RevId: 560215389
1 parent 35ffd82 commit b1666e6

File tree

8 files changed

+233
-4
lines changed

8 files changed

+233
-4
lines changed

google/cloud/dialogflow/v2/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ load(
396396

397397
csharp_proto_library(
398398
name = "dialogflow_csharp_proto",
399-
extra_opts = [""],
400399
deps = [":dialogflow_proto"],
401400
)
402401

google/cloud/dialogflow/v2/answer_record.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,22 @@ message AgentAssistantFeedback {
273273
string summary_text = 3;
274274
}
275275

276+
// Feedback for knowledge search.
277+
message KnowledgeSearchFeedback {
278+
// Whether the answer was copied by the human agent or not.
279+
// If the value is set to be true,
280+
// [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked]
281+
// will be updated to be true.
282+
bool answer_copied = 1;
283+
284+
// The URIs clicked by the human agent. The value is appended for each
285+
// [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest].
286+
// If the value is not empty,
287+
// [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked]
288+
// will be updated to be true.
289+
repeated string clicked_uris = 2;
290+
}
291+
276292
// Optional. Whether or not the suggested answer is relevant.
277293
//
278294
// For example:
@@ -307,6 +323,10 @@ message AgentAssistantFeedback {
307323
// Optional. Feedback for conversation summarization.
308324
SummarizationFeedback summarization_feedback = 4
309325
[(google.api.field_behavior) = OPTIONAL];
326+
327+
// Optional. Feedback for knowledge search.
328+
KnowledgeSearchFeedback knowledge_search_feedback = 5
329+
[(google.api.field_behavior) = OPTIONAL];
310330
}
311331

312332
// Represents a record of a human agent assist answer.
@@ -319,5 +339,9 @@ message AgentAssistantRecord {
319339

320340
// Output only. The FAQ answer.
321341
FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
342+
343+
// Output only. Dialogflow assist answer.
344+
DialogflowAssistAnswer dialogflow_assist_answer = 7
345+
[(google.api.field_behavior) = OUTPUT_ONLY];
322346
}
323347
}

google/cloud/dialogflow/v2/audio_config.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ message SpeechToTextConfig {
279279
// documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
280280
// for more details.
281281
string model = 2;
282+
283+
// Use timeout based endpointing, interpreting endpointer sensitivy as
284+
// seconds of timeout value.
285+
bool use_timeout_based_endpointing = 11;
282286
}
283287

284288
// [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling)

google/cloud/dialogflow/v2/conversation.proto

Lines changed: 118 additions & 0 deletions
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/cloud/dialogflow/v2/conversation_profile.proto";
2424
import "google/cloud/dialogflow/v2/participant.proto";
25+
import "google/cloud/dialogflow/v2/session.proto";
2526
import "google/protobuf/timestamp.proto";
2627

2728
option cc_enable_arenas = true;
@@ -154,6 +155,27 @@ service Conversations {
154155
}
155156
};
156157
}
158+
159+
// Get answers for the given query based on knowledge documents.
160+
rpc SearchKnowledge(SearchKnowledgeRequest)
161+
returns (SearchKnowledgeResponse) {
162+
option (google.api.http) = {
163+
post: "/v2/{parent=projects/*}/suggestions:searchKnowledge"
164+
body: "*"
165+
additional_bindings {
166+
post: "/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge"
167+
body: "*"
168+
}
169+
additional_bindings {
170+
post: "/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge"
171+
body: "*"
172+
}
173+
additional_bindings {
174+
post: "/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge"
175+
body: "*"
176+
}
177+
};
178+
}
157179
}
158180

159181
// Represents a conversation.
@@ -563,3 +585,99 @@ message GenerateStatelessSummaryResponse {
563585
// the request if there weren't that many messages in the conversation.
564586
int32 context_size = 3;
565587
}
588+
589+
// The request message for
590+
// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2.Conversations.SearchKnowledge].
591+
message SearchKnowledgeRequest {
592+
// The parent resource contains the conversation profile
593+
// Format: 'projects/<Project ID>' or `projects/<Project
594+
// ID>/locations/<Location ID>`.
595+
string parent = 6;
596+
597+
// Required. The natural language text query for knowledge search.
598+
TextInput query = 1 [(google.api.field_behavior) = REQUIRED];
599+
600+
// Required. The conversation profile used to configure the search.
601+
// Format: `projects/<Project ID>/locations/<Location
602+
// ID>/conversationProfiles/<Conversation Profile ID>`.
603+
string conversation_profile = 2 [
604+
(google.api.field_behavior) = REQUIRED,
605+
(google.api.resource_reference) = {
606+
type: "dialogflow.googleapis.com/ConversationProfile"
607+
}
608+
];
609+
610+
// The ID of the search session.
611+
// The session_id can be combined with Dialogflow V3 Agent ID retrieved from
612+
// conversation profile or on its own to identify a search session. The search
613+
// history of the same session will impact the search result. It's up to the
614+
// API caller to choose an appropriate `Session ID`. It can be a random number
615+
// or some type of session identifiers (preferably hashed). The length must
616+
// not exceed 36 characters.
617+
string session_id = 3;
618+
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+
}];
625+
626+
// The name of the latest conversation message when the request is
627+
// triggered.
628+
// Format: `projects/<Project ID>/locations/<Location
629+
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
630+
string latest_message = 5 [(google.api.resource_reference) = {
631+
type: "dialogflow.googleapis.com/Message"
632+
}];
633+
}
634+
635+
// The response message for
636+
// [Conversations.SearchKnowledge][google.cloud.dialogflow.v2.Conversations.SearchKnowledge].
637+
message SearchKnowledgeResponse {
638+
// Most relevant snippets extracted from articles in the given knowledge base,
639+
// ordered by confidence.
640+
repeated SearchKnowledgeAnswer answers = 2;
641+
}
642+
643+
// Represents a SearchKnowledge answer.
644+
message SearchKnowledgeAnswer {
645+
// The type of the answer.
646+
enum AnswerType {
647+
// The answer has a unspecified type.
648+
ANSWER_TYPE_UNSPECIFIED = 0;
649+
650+
// The answer is from FAQ doucments.
651+
FAQ = 1;
652+
653+
// The answer is from generative model.
654+
GENERATIVE = 2;
655+
}
656+
657+
// The sources of the answers.
658+
message AnswerSource {
659+
// The title of the article.
660+
string title = 1;
661+
662+
// The URI of the article.
663+
string uri = 2;
664+
665+
// The relevant snippet of the article.
666+
string snippet = 3;
667+
}
668+
669+
// The piece of text from the knowledge base documents that answers
670+
// the search query
671+
string answer = 1;
672+
673+
// The type of the answer.
674+
AnswerType answer_type = 2;
675+
676+
// All sources used to generate the answer.
677+
repeated AnswerSource answer_sources = 3;
678+
679+
// The name of the answer record.
680+
// Format: `projects/<Project ID>/locations/<location ID>/answer
681+
// Records/<Answer Record ID>`
682+
string answer_record = 5;
683+
}

google/cloud/dialogflow/v2/conversation_profile.proto

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,17 @@ message HumanAgentAssistantConfig {
411411
// Automatically iterates all participants and tries to compile
412412
// suggestions.
413413
//
414-
// Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST.
414+
// Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST,
415+
// KNOWLEDGE_ASSIST.
415416
bool enable_event_based_suggestion = 3;
416417

418+
// Optional. Disable the logging of search queries sent by human agents. It
419+
// can prevent those queries from being stored at answer records.
420+
//
421+
// Supported features: KNOWLEDGE_SEARCH.
422+
bool disable_agent_query_logging = 14
423+
[(google.api.field_behavior) = OPTIONAL];
424+
417425
// Settings of suggestion trigger.
418426
//
419427
// Currently, only ARTICLE_SUGGESTION and FAQ will use this field.
@@ -486,6 +494,20 @@ message HumanAgentAssistantConfig {
486494
//
487495
// Supported feature: DIALOGFLOW_ASSIST.
488496
message DialogflowQuerySource {
497+
// The configuration used for human agent side Dialogflow assist
498+
// suggestion.
499+
message HumanAgentSideConfig {
500+
// Optional. The name of a dialogflow virtual agent used for intent
501+
// detection and suggestion triggered by human agent.
502+
// Format: `projects/<Project ID>/locations/<Location ID>/agent`.
503+
string agent = 1 [
504+
(google.api.field_behavior) = OPTIONAL,
505+
(google.api.resource_reference) = {
506+
type: "dialogflow.googleapis.com/Agent"
507+
}
508+
];
509+
}
510+
489511
// Required. The name of a Dialogflow virtual agent used for end user side
490512
// intent detection and suggestion. Format: `projects/<Project
491513
// ID>/locations/<Location ID>/agent`. When multiple agents are allowed in
@@ -496,6 +518,10 @@ message HumanAgentAssistantConfig {
496518
type: "dialogflow.googleapis.com/Agent"
497519
}
498520
];
521+
522+
// Optional. The Dialogflow assist configuration for human agent.
523+
HumanAgentSideConfig human_agent_side_config = 3
524+
[(google.api.field_behavior) = OPTIONAL];
499525
}
500526

501527
// Settings that determine how to filter recent conversation context when
@@ -738,6 +764,9 @@ message SuggestionFeature {
738764

739765
// Run smart reply model for chat.
740766
SMART_REPLY = 3;
767+
768+
// Run knowledge search with text input from agent or text generated query.
769+
KNOWLEDGE_SEARCH = 14;
741770
}
742771

743772
// Type of Human Agent Assistant API feature to request.

google/cloud/dialogflow/v2/dialogflow_grpc_service_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
{
4242
"service": "google.cloud.dialogflow.v2.Fulfillments"
4343
},
44+
{
45+
"service": "google.cloud.dialogflow.v2.Generators"
46+
},
4447
{
4548
"service": "google.cloud.dialogflow.v2.Intents"
4649
},

google/cloud/dialogflow/v2/participant.proto

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ message AnalyzeContentRequest {
409409

410410
// An input event to send to Dialogflow.
411411
EventInput event_input = 8;
412+
413+
// An input representing the selection of a suggestion.
414+
SuggestionInput suggestion_input = 12;
412415
}
413416

414417
// Speech synthesis configuration.
@@ -578,7 +581,7 @@ message StreamingAnalyzeContentRequest {
578581
// The UTF-8 encoded natural language text to be processed. Must be sent if
579582
// `text_config` is set in the first message. Text length must not exceed
580583
// 256 bytes for virtual agent interactions. The `input_text` field can be
581-
// only sent once.
584+
// only sent once, and would cancel the speech recognition if any ongoing.
582585
string input_text = 6;
583586

584587
// The DTMF digits used to invoke intent and fill in parameter value.
@@ -980,6 +983,41 @@ message SmartReplyAnswer {
980983
}];
981984
}
982985

986+
// Represents an intent suggestion.
987+
message IntentSuggestion {
988+
// The display name of the intent.
989+
string display_name = 1;
990+
991+
// The name of the intent.
992+
oneof intent {
993+
// The unique identifier of this
994+
// [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects/<Project
995+
// ID>/locations/<Location ID>/agent/intents/<Intent ID>`.
996+
string intent_v2 = 2;
997+
}
998+
999+
// Human readable description for better understanding an intent like its
1000+
// scope, content, result etc. Maximum character limit: 140 characters.
1001+
string description = 5;
1002+
}
1003+
1004+
// Represents a Dialogflow assist answer.
1005+
message DialogflowAssistAnswer {
1006+
// Result from DetectIntent for one matched intent.
1007+
oneof result {
1008+
// Result from v2 agent.
1009+
QueryResult query_result = 1;
1010+
1011+
// An intent suggestion generated from conversation.
1012+
IntentSuggestion intent_suggestion = 5;
1013+
}
1014+
1015+
// The name of answer record, in the format of
1016+
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
1017+
// ID>"
1018+
string answer_record = 2;
1019+
}
1020+
9831021
// One response of different type of suggestion response which is used in
9841022
// the response of
9851023
// [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent]
@@ -1049,6 +1087,17 @@ message MessageAnnotation {
10491087
bool contain_entities = 2;
10501088
}
10511089

1090+
// Represents the selection of a suggestion.
1091+
message SuggestionInput {
1092+
// Required. The ID of a suggestion selected by the human agent.
1093+
// The suggestion(s) were generated in a previous call to
1094+
// request Dialogflow assist.
1095+
// The format is:
1096+
// `projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
1097+
// ID>` where <Answer Record ID> is an alphanumeric string.
1098+
string answer_record = 1 [(google.api.field_behavior) = REQUIRED];
1099+
}
1100+
10521101
// Represents the parameters of human assist query.
10531102
message AssistQueryParameters {
10541103
// Key-value filters on the metadata of documents returned by article

google/cloud/dialogflow/v2/session.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,12 @@ message CloudConversationDebuggingInfo {
545545
// beginning of the stream.
546546
google.protobuf.Duration single_utterance_end_time_offset = 14;
547547

548-
// No speech timeout settings observed at runtime.
548+
// No speech timeout settings for the stream.
549549
google.protobuf.Duration no_speech_timeout = 15;
550550

551+
// Speech endpointing timeout settings for the stream.
552+
google.protobuf.Duration endpointing_timeout = 19;
553+
551554
// Whether the streaming terminates with an injected text query.
552555
bool is_input_text = 16;
553556

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy