Skip to content

Commit 369e98e

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add CCAI API
PiperOrigin-RevId: 361003369
1 parent 4b4e8be commit 369e98e

13 files changed

Lines changed: 3055 additions & 0 deletions

google/cloud/dialogflow/v2beta1/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ proto_library(
2222
name = "dialogflow_proto",
2323
srcs = [
2424
"agent.proto",
25+
"answer_record.proto",
2526
"audio_config.proto",
2627
"context.proto",
28+
"conversation.proto",
29+
"conversation_event.proto",
30+
"conversation_profile.proto",
2731
"document.proto",
2832
"entity_type.proto",
2933
"environment.proto",
3034
"gcs.proto",
35+
"human_agent_assistant_event.proto",
3136
"intent.proto",
3237
"knowledge_base.proto",
38+
"participant.proto",
3339
"session.proto",
3440
"session_entity_type.proto",
3541
"validation_result.proto",
@@ -43,6 +49,7 @@ proto_library(
4349
"//google/longrunning:operations_proto",
4450
"//google/rpc:status_proto",
4551
"//google/type:latlng_proto",
52+
"@com_google_protobuf//:any_proto",
4653
"@com_google_protobuf//:duration_proto",
4754
"@com_google_protobuf//:empty_proto",
4855
"@com_google_protobuf//:field_mask_proto",
@@ -56,6 +63,7 @@ proto_library_with_info(
5663
deps = [
5764
":dialogflow_proto",
5865
"//google/cloud:common_resources_proto",
66+
"//google/cloud/dialogflow:common_resources_proto",
5967
],
6068
)
6169

@@ -148,6 +156,7 @@ go_gapic_library(
148156
"//google/longrunning:longrunning_go_proto",
149157
"@com_google_cloud_go//longrunning:go_default_library",
150158
"@com_google_cloud_go//longrunning/autogen:go_default_library",
159+
"@io_bazel_rules_go//proto/wkt:any_go_proto",
151160
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
152161
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
153162
],
Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
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.v2beta1;
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/cloud/dialogflow/v2beta1/participant.proto";
24+
import "google/protobuf/empty.proto";
25+
import "google/protobuf/field_mask.proto";
26+
import "google/protobuf/timestamp.proto";
27+
28+
option cc_enable_arenas = true;
29+
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
30+
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
31+
option java_multiple_files = true;
32+
option java_outer_classname = "AnswerRecordsProto";
33+
option java_package = "com.google.cloud.dialogflow.v2beta1";
34+
option objc_class_prefix = "DF";
35+
36+
// Service for managing [AnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecord].
37+
service AnswerRecords {
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+
// Deprecated.
44+
// Retrieves a specific answer record.
45+
rpc GetAnswerRecord(GetAnswerRecordRequest) returns (AnswerRecord) {
46+
option deprecated = true;
47+
option (google.api.http) = {
48+
get: "/v2beta1/{name=projects/*/answerRecords/*}"
49+
additional_bindings {
50+
get: "/v2beta1/{name=projects/*/locations/*/answerRecords/*}"
51+
}
52+
};
53+
}
54+
55+
// Returns the list of all answer records in the specified project in reverse
56+
// chronological order.
57+
rpc ListAnswerRecords(ListAnswerRecordsRequest) returns (ListAnswerRecordsResponse) {
58+
option (google.api.http) = {
59+
get: "/v2beta1/{parent=projects/*}/answerRecords"
60+
additional_bindings {
61+
get: "/v2beta1/{parent=projects/*/locations/*}/answerRecords"
62+
}
63+
};
64+
option (google.api.method_signature) = "parent";
65+
}
66+
67+
// Updates the specified answer record.
68+
rpc UpdateAnswerRecord(UpdateAnswerRecordRequest) returns (AnswerRecord) {
69+
option (google.api.http) = {
70+
patch: "/v2beta1/{answer_record.name=projects/*/answerRecords/*}"
71+
body: "answer_record"
72+
additional_bindings {
73+
patch: "/v2beta1/{answer_record.name=projects/*/locations/*/answerRecords/*}"
74+
body: "answer_record"
75+
}
76+
};
77+
option (google.api.method_signature) = "answer_record,update_mask";
78+
}
79+
}
80+
81+
// Answer records are records to manage answer history and feedbacks for
82+
// Dialogflow.
83+
//
84+
// Currently, answer record includes:
85+
//
86+
// - human agent assistant article suggestion
87+
// - human agent assistant faq article
88+
//
89+
// It doesn't include:
90+
//
91+
// - `DetectIntent` intent matching
92+
// - `DetectIntent` knowledge
93+
//
94+
// Answer records are not related to the conversation history in the
95+
// Dialogflow Console. A Record is generated even when the end-user disables
96+
// conversation history in the console. Records are created when there's a human
97+
// agent assistant suggestion generated.
98+
//
99+
// A typical workflow for customers provide feedback to an answer is:
100+
//
101+
// 1. For human agent assistant, customers get suggestion via ListSuggestions
102+
// API. Together with the answers, [AnswerRecord.name][google.cloud.dialogflow.v2beta1.AnswerRecord.name] are returned to the
103+
// customers.
104+
// 2. The customer uses the [AnswerRecord.name][google.cloud.dialogflow.v2beta1.AnswerRecord.name] to call the
105+
// [UpdateAnswerRecord][] method to send feedback about a specific answer
106+
// that they believe is wrong.
107+
message AnswerRecord {
108+
option (google.api.resource) = {
109+
type: "dialogflow.googleapis.com/AnswerRecord"
110+
pattern: "projects/{project}/answerRecords/{answer_record}"
111+
pattern: "projects/{project}/locations/{location}/answerRecords/{answer_record}"
112+
};
113+
114+
// The unique identifier of this answer record.
115+
// Required for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] method.
116+
// Format: `projects/<Project ID>/locations/<Location
117+
// ID>/answerRecords/<Answer Record ID>`.
118+
string name = 1;
119+
120+
// Optional. The AnswerFeedback for this record. You can set this with
121+
// [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] in order to give us feedback about
122+
// this answer.
123+
AnswerFeedback answer_feedback = 3;
124+
125+
// Output only. The record for this answer.
126+
oneof record {
127+
// Output only. The record for human agent assistant.
128+
AgentAssistantRecord agent_assistant_record = 4;
129+
}
130+
}
131+
132+
// Represents a record of a human agent assistant answer.
133+
message AgentAssistantRecord {
134+
// Output only. The agent assistant answer.
135+
oneof answer {
136+
// Output only. The article suggestion answer.
137+
ArticleAnswer article_suggestion_answer = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
138+
139+
// Output only. The FAQ answer.
140+
FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
141+
}
142+
}
143+
144+
// Represents feedback the customer has about the quality & correctness of a
145+
// certain answer in a conversation.
146+
message AnswerFeedback {
147+
// The correctness level of an answer.
148+
enum CorrectnessLevel {
149+
// Correctness level unspecified.
150+
CORRECTNESS_LEVEL_UNSPECIFIED = 0;
151+
152+
// Answer is totally wrong.
153+
NOT_CORRECT = 1;
154+
155+
// Answer is partially correct.
156+
PARTIALLY_CORRECT = 2;
157+
158+
// Answer is fully correct.
159+
FULLY_CORRECT = 3;
160+
}
161+
162+
// The correctness level of the specific answer.
163+
CorrectnessLevel correctness_level = 1;
164+
165+
// Normally, detail feedback is provided when answer is not fully correct.
166+
oneof detail_feedback {
167+
// Optional. Detail feedback of agent assistant suggestions.
168+
AgentAssistantFeedback agent_assistant_detail_feedback = 2;
169+
}
170+
171+
// Indicates whether the answer/item was clicked by the human agent
172+
// or not. Default to false.
173+
bool clicked = 3;
174+
175+
// Time when the answer/item was clicked.
176+
google.protobuf.Timestamp click_time = 5;
177+
178+
// Indicates whether the answer/item was displayed to the human
179+
// agent in the agent desktop UI. Default to false.
180+
bool displayed = 4;
181+
182+
// Time when the answer/item was displayed.
183+
google.protobuf.Timestamp display_time = 6;
184+
}
185+
186+
// Detail feedback of Agent Assistant result.
187+
message AgentAssistantFeedback {
188+
// Feedback for conversation summarization.
189+
message SummarizationFeedback {
190+
// Timestamp when composing of the summary starts.
191+
google.protobuf.Timestamp start_timestamp = 1;
192+
193+
// Timestamp when the summary was submitted.
194+
google.protobuf.Timestamp submit_timestamp = 2;
195+
196+
// Text of actual submitted summary.
197+
string summary_text = 3;
198+
}
199+
200+
// Relevance of an answer.
201+
enum AnswerRelevance {
202+
// Answer relevance unspecified.
203+
ANSWER_RELEVANCE_UNSPECIFIED = 0;
204+
205+
// Answer is irrelevant to query.
206+
IRRELEVANT = 1;
207+
208+
// Answer is relevant to query.
209+
RELEVANT = 2;
210+
}
211+
212+
// Correctness of document.
213+
enum DocumentCorrectness {
214+
// Document correctness unspecified.
215+
DOCUMENT_CORRECTNESS_UNSPECIFIED = 0;
216+
217+
// Information in document is incorrect.
218+
INCORRECT = 1;
219+
220+
// Information in document is correct.
221+
CORRECT = 2;
222+
}
223+
224+
// Efficiency of document.
225+
enum DocumentEfficiency {
226+
// Document efficiency unspecified.
227+
DOCUMENT_EFFICIENCY_UNSPECIFIED = 0;
228+
229+
// Document is inefficient.
230+
INEFFICIENT = 1;
231+
232+
// Document is efficient.
233+
EFFICIENT = 2;
234+
}
235+
236+
// Optional. Whether or not the suggested answer is relevant.
237+
//
238+
// For example:
239+
//
240+
// * Query: "Can I change my mailing address?"
241+
// * Suggested document says: "Items must be returned/exchanged within 60
242+
// days of the purchase date."
243+
// * [answer_relevance][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT]
244+
AnswerRelevance answer_relevance = 1;
245+
246+
// Optional. Whether or not the information in the document is correct.
247+
//
248+
// For example:
249+
//
250+
// * Query: "Can I return the package in 2 days once received?"
251+
// * Suggested document says: "Items must be returned/exchanged within 60
252+
// days of the purchase date."
253+
// * Ground truth: "No return or exchange is allowed."
254+
// * [document_correctness]: INCORRECT
255+
DocumentCorrectness document_correctness = 2;
256+
257+
// Optional. Whether or not the suggested document is efficient. For example,
258+
// if the document is poorly written, hard to understand, hard to use or
259+
// too long to find useful information, [document_efficiency][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.document_efficiency] is
260+
// [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT].
261+
DocumentEfficiency document_efficiency = 3;
262+
263+
// Feedback for conversation summarization.
264+
SummarizationFeedback summarization_feedback = 4;
265+
}
266+
267+
// Request message for [AnswerRecords.GetAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.GetAnswerRecord].
268+
message GetAnswerRecordRequest {
269+
// Required. The name of the answer record to retrieve.
270+
// Format: `projects/<Project ID>/locations/<Location
271+
// ID>/answerRecords/<Answer Record Id>`.
272+
string name = 1;
273+
}
274+
275+
// Request message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords].
276+
message ListAnswerRecordsRequest {
277+
// Required. The project to list all answer records for in reverse
278+
// chronological order. Format: `projects/<Project ID>/locations/<Location
279+
// ID>`.
280+
string parent = 1 [(google.api.resource_reference) = {
281+
child_type: "dialogflow.googleapis.com/AnswerRecord"
282+
}];
283+
284+
// Optional. The maximum number of records to return in a single page.
285+
// The server may return fewer records than this. If unspecified, we use 10.
286+
// The maximum is 100.
287+
int32 page_size = 3;
288+
289+
// Optional. The
290+
// [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token]
291+
// value returned from a previous list request used to continue listing on
292+
// the next page.
293+
string page_token = 4;
294+
}
295+
296+
// Response message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords].
297+
message ListAnswerRecordsResponse {
298+
// The list of answer records.
299+
repeated AnswerRecord answer_records = 1;
300+
301+
// A token to retrieve next page of results. Or empty if there are no more
302+
// results.
303+
// Pass this value in the
304+
// [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.page_token]
305+
// field in the subsequent call to `ListAnswerRecords` method to retrieve the
306+
// next page of results.
307+
string next_page_token = 2;
308+
}
309+
310+
// Request message for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord].
311+
message UpdateAnswerRecordRequest {
312+
// Required. Answer record to update.
313+
AnswerRecord answer_record = 1 [
314+
(google.api.field_behavior) = REQUIRED,
315+
(google.api.resource_reference) = {
316+
type: "dialogflow.googleapis.com/AnswerRecord"
317+
}
318+
];
319+
320+
// Required. The mask to control which fields get updated.
321+
google.protobuf.FieldMask update_mask = 2;
322+
}

google/cloud/dialogflow/v2beta1/audio_config.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ message InputAudioConfig {
248248
// Note: When specified, InputAudioConfig.single_utterance takes precedence
249249
// over StreamingDetectIntentRequest.single_utterance.
250250
bool single_utterance = 8;
251+
252+
// Only used in [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] and
253+
// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent].
254+
// If `false` and recognition doesn't return any result, trigger
255+
// `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.
256+
bool disable_no_speech_recognized_event = 14;
251257
}
252258

253259
// Description of which voice to use for speech synthesis.
@@ -360,6 +366,15 @@ enum OutputAudioEncoding {
360366
OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3;
361367
}
362368

369+
// Configures speech transcription for [ConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfile].
370+
message SpeechToTextConfig {
371+
// Optional. The speech model used in speech to text.
372+
// `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as
373+
// `USE_ENHANCED`. It can be overridden in [AnalyzeContentRequest][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest] and
374+
// [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest] request.
375+
SpeechModelVariant speech_model_variant = 1 [(google.api.field_behavior) = OPTIONAL];
376+
}
377+
363378
// [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling)
364379
// digit in Telephony Gateway.
365380
enum TelephonyDtmf {

0 commit comments

Comments
 (0)