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