Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit b6f5738

Browse files
feat: added support for regionalization for document API (#722)
* feat: added support for regionalization for document API docs: suggested to always use version for production traffic when calling DetectIntent.marked match_mode in Agent message as deprecated PiperOrigin-RevId: 345544333 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Dec 3 15:08:48 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: a6cbc5fabe30ffce1a46885e80ec552fd2ea6b8d Source-Link: googleapis/googleapis@a6cbc5f * chore: generate GAPIC metadata JSON file PiperOrigin-RevId: 345596855 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Dec 3 21:00:34 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: d189e871205fea665a9648f7c4676f027495ccaf Source-Link: googleapis/googleapis@d189e87
1 parent be20d3d commit b6f5738

29 files changed

+6120
-2052
lines changed

protos/google/cloud/dialogflow/v2beta1/agent.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ message Agent {
305305
bool enable_logging = 8;
306306

307307
// Optional. Determines how intents are detected from user queries.
308-
MatchMode match_mode = 9;
308+
MatchMode match_mode = 9 [deprecated = true];
309309

310310
// Optional. To filter out false positive results and still get variety in
311311
// matched natural language inputs for your agent, you can tune the machine

protos/google/cloud/dialogflow/v2beta1/audio_config.proto

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,6 @@ option java_outer_classname = "AudioConfigProto";
3030
option java_package = "com.google.cloud.dialogflow.v2beta1";
3131
option objc_class_prefix = "DF";
3232

33-
// Hints for the speech recognizer to help with recognition in a specific
34-
// conversation state.
35-
message SpeechContext {
36-
// Optional. A list of strings containing words and phrases that the speech
37-
// recognizer should recognize with higher likelihood.
38-
//
39-
// This list can be used to:
40-
//
41-
// * improve accuracy for words and phrases you expect the user to say,
42-
// e.g. typical commands for your Dialogflow agent
43-
// * add additional words to the speech recognizer vocabulary
44-
// * ...
45-
//
46-
// See the [Cloud Speech
47-
// documentation](https://cloud.google.com/speech-to-text/quotas) for usage
48-
// limits.
49-
repeated string phrases = 1;
50-
51-
// Optional. Boost for this context compared to other contexts:
52-
//
53-
// * If the boost is positive, Dialogflow will increase the probability that
54-
// the phrases in this context are recognized over similar sounding phrases.
55-
// * If the boost is unspecified or non-positive, Dialogflow will not apply
56-
// any boost.
57-
//
58-
// Dialogflow recommends that you use boosts in the range (0, 20] and that you
59-
// find a value that fits your use case with binary search.
60-
float boost = 2;
61-
}
62-
6333
// Audio encoding of the audio content sent in the conversational query request.
6434
// Refer to the
6535
// [Cloud Speech API
@@ -109,6 +79,36 @@ enum AudioEncoding {
10979
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
11080
}
11181

82+
// Hints for the speech recognizer to help with recognition in a specific
83+
// conversation state.
84+
message SpeechContext {
85+
// Optional. A list of strings containing words and phrases that the speech
86+
// recognizer should recognize with higher likelihood.
87+
//
88+
// This list can be used to:
89+
//
90+
// * improve accuracy for words and phrases you expect the user to say,
91+
// e.g. typical commands for your Dialogflow agent
92+
// * add additional words to the speech recognizer vocabulary
93+
// * ...
94+
//
95+
// See the [Cloud Speech
96+
// documentation](https://cloud.google.com/speech-to-text/quotas) for usage
97+
// limits.
98+
repeated string phrases = 1;
99+
100+
// Optional. Boost for this context compared to other contexts:
101+
//
102+
// * If the boost is positive, Dialogflow will increase the probability that
103+
// the phrases in this context are recognized over similar sounding phrases.
104+
// * If the boost is unspecified or non-positive, Dialogflow will not apply
105+
// any boost.
106+
//
107+
// Dialogflow recommends that you use boosts in the range (0, 20] and that you
108+
// find a value that fits your use case with binary search.
109+
float boost = 2;
110+
}
111+
112112
// Information for a word recognized by the speech recognizer.
113113
message SpeechWordInfo {
114114
// The word this info is for.

protos/google/cloud/dialogflow/v2beta1/document.proto

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ service Documents {
4949
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
5050
option (google.api.http) = {
5151
get: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents"
52+
additional_bindings {
53+
get: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
54+
}
5255
additional_bindings {
5356
get: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents"
5457
}
@@ -63,6 +66,9 @@ service Documents {
6366
rpc GetDocument(GetDocumentRequest) returns (Document) {
6467
option (google.api.http) = {
6568
get: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}"
69+
additional_bindings {
70+
get: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
71+
}
6672
additional_bindings {
6773
get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}"
6874
}
@@ -78,6 +84,10 @@ service Documents {
7884
option (google.api.http) = {
7985
post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents"
8086
body: "document"
87+
additional_bindings {
88+
post: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents"
89+
body: "document"
90+
}
8191
additional_bindings {
8292
post: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents"
8393
body: "document"
@@ -97,6 +107,9 @@ service Documents {
97107
rpc DeleteDocument(DeleteDocumentRequest) returns (google.longrunning.Operation) {
98108
option (google.api.http) = {
99109
delete: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}"
110+
additional_bindings {
111+
delete: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}"
112+
}
100113
additional_bindings {
101114
delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}"
102115
}
@@ -116,6 +129,10 @@ service Documents {
116129
option (google.api.http) = {
117130
patch: "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}"
118131
body: "document"
132+
additional_bindings {
133+
patch: "/v2beta1/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}"
134+
body: "document"
135+
}
119136
additional_bindings {
120137
patch: "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}"
121138
body: "document"
@@ -143,6 +160,10 @@ service Documents {
143160
option (google.api.http) = {
144161
post: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload"
145162
body: "*"
163+
additional_bindings {
164+
post: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload"
165+
body: "*"
166+
}
146167
additional_bindings {
147168
post: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload"
148169
body: "*"
@@ -167,6 +188,7 @@ message Document {
167188
option (google.api.resource) = {
168189
type: "dialogflow.googleapis.com/Document"
169190
pattern: "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}"
191+
pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}"
170192
};
171193

172194
// The status of a reload attempt.
@@ -201,8 +223,8 @@ message Document {
201223

202224
// Optional. The document resource name.
203225
// The name must be empty when creating a document.
204-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base
205-
// ID>/documents/<Document ID>`.
226+
// Format: `projects/<Project ID>/locations/<Location
227+
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
206228
string name = 1 [(google.api.field_behavior) = OPTIONAL];
207229

208230
// Required. The display name of the document. The name must be 1024 bytes or
@@ -266,8 +288,8 @@ message Document {
266288
// Request message for [Documents.GetDocument][google.cloud.dialogflow.v2beta1.Documents.GetDocument].
267289
message GetDocumentRequest {
268290
// Required. The name of the document to retrieve.
269-
// Format `projects/<Project ID>/knowledgeBases/<Knowledge Base
270-
// ID>/documents/<Document ID>`.
291+
// Format `projects/<Project ID>/locations/<Location
292+
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
271293
string name = 1 [
272294
(google.api.field_behavior) = REQUIRED,
273295
(google.api.resource_reference) = {
@@ -279,7 +301,8 @@ message GetDocumentRequest {
279301
// Request message for [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments].
280302
message ListDocumentsRequest {
281303
// Required. The knowledge base to list all documents for.
282-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
304+
// Format: `projects/<Project ID>/locations/<Location
305+
// ID>/knowledgeBases/<Knowledge Base ID>`.
283306
string parent = 1 [
284307
(google.api.field_behavior) = REQUIRED,
285308
(google.api.resource_reference) = {
@@ -331,7 +354,8 @@ message ListDocumentsResponse {
331354
// Request message for [Documents.CreateDocument][google.cloud.dialogflow.v2beta1.Documents.CreateDocument].
332355
message CreateDocumentRequest {
333356
// Required. The knowledge base to create a document for.
334-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
357+
// Format: `projects/<Project ID>/locations/<Location
358+
// ID>/knowledgeBases/<Knowledge Base ID>`.
335359
string parent = 1 [
336360
(google.api.field_behavior) = REQUIRED,
337361
(google.api.resource_reference) = {
@@ -341,13 +365,17 @@ message CreateDocumentRequest {
341365

342366
// Required. The document to create.
343367
Document document = 2 [(google.api.field_behavior) = REQUIRED];
368+
369+
// Whether to import custom metadata from Google Cloud Storage.
370+
// Only valid when the document source is Google Cloud Storage URI.
371+
bool import_gcs_custom_metadata = 3;
344372
}
345373

346374
// Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2beta1.Documents.DeleteDocument].
347375
message DeleteDocumentRequest {
348376
// Required. The name of the document to delete.
349-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base
350-
// ID>/documents/<Document ID>`.
377+
// Format: `projects/<Project ID>/locations/<Location
378+
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
351379
string name = 1 [
352380
(google.api.field_behavior) = REQUIRED,
353381
(google.api.resource_reference) = {
@@ -391,8 +419,8 @@ message KnowledgeOperationMetadata {
391419
// Request message for [Documents.ReloadDocument][google.cloud.dialogflow.v2beta1.Documents.ReloadDocument].
392420
message ReloadDocumentRequest {
393421
// Required. The name of the document to reload.
394-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base
395-
// ID>/documents/<Document ID>`
422+
// Format: `projects/<Project ID>/locations/<Location
423+
// ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`
396424
string name = 1 [
397425
(google.api.field_behavior) = REQUIRED,
398426
(google.api.resource_reference) = {
@@ -408,4 +436,8 @@ message ReloadDocumentRequest {
408436
// If not provided, the Document's existing source will be reloaded.
409437
GcsSource gcs_source = 3;
410438
}
439+
440+
// Whether to import custom metadata from Google Cloud Storage.
441+
// Only valid when the document source is Google Cloud Storage URI.
442+
bool import_gcs_custom_metadata = 4;
411443
}

protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ service KnowledgeBases {
4545
rpc ListKnowledgeBases(ListKnowledgeBasesRequest) returns (ListKnowledgeBasesResponse) {
4646
option (google.api.http) = {
4747
get: "/v2beta1/{parent=projects/*}/knowledgeBases"
48+
additional_bindings {
49+
get: "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases"
50+
}
4851
additional_bindings {
4952
get: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
5053
}
@@ -59,6 +62,9 @@ service KnowledgeBases {
5962
rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) {
6063
option (google.api.http) = {
6164
get: "/v2beta1/{name=projects/*/knowledgeBases/*}"
65+
additional_bindings {
66+
get: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}"
67+
}
6268
additional_bindings {
6369
get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
6470
}
@@ -74,6 +80,10 @@ service KnowledgeBases {
7480
option (google.api.http) = {
7581
post: "/v2beta1/{parent=projects/*}/knowledgeBases"
7682
body: "knowledge_base"
83+
additional_bindings {
84+
post: "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases"
85+
body: "knowledge_base"
86+
}
7787
additional_bindings {
7888
post: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
7989
body: "knowledge_base"
@@ -89,6 +99,9 @@ service KnowledgeBases {
8999
rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (google.protobuf.Empty) {
90100
option (google.api.http) = {
91101
delete: "/v2beta1/{name=projects/*/knowledgeBases/*}"
102+
additional_bindings {
103+
delete: "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}"
104+
}
92105
additional_bindings {
93106
delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
94107
}
@@ -104,6 +117,10 @@ service KnowledgeBases {
104117
option (google.api.http) = {
105118
patch: "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}"
106119
body: "knowledge_base"
120+
additional_bindings {
121+
patch: "/v2beta1/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}"
122+
body: "knowledge_base"
123+
}
107124
additional_bindings {
108125
patch: "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}"
109126
body: "knowledge_base"
@@ -128,11 +145,13 @@ message KnowledgeBase {
128145
option (google.api.resource) = {
129146
type: "dialogflow.googleapis.com/KnowledgeBase"
130147
pattern: "projects/{project}/knowledgeBases/{knowledge_base}"
148+
pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}"
131149
};
132150

133151
// The knowledge base resource name.
134152
// The name must be empty when creating a knowledge base.
135-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
153+
// Format: `projects/<Project ID>/locations/<Location
154+
// ID>/knowledgeBases/<Knowledge Base ID>`.
136155
string name = 1;
137156

138157
// Required. The display name of the knowledge base. The name must be 1024
@@ -148,7 +167,7 @@ message KnowledgeBase {
148167
// Request message for [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
149168
message ListKnowledgeBasesRequest {
150169
// Required. The project to list of knowledge bases for.
151-
// Format: `projects/<Project ID>`.
170+
// Format: `projects/<Project ID>/locations/<Location ID>`.
152171
string parent = 1 [
153172
(google.api.field_behavior) = REQUIRED,
154173
(google.api.resource_reference) = {
@@ -205,7 +224,8 @@ message ListKnowledgeBasesResponse {
205224
// Request message for [KnowledgeBases.GetKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBase].
206225
message GetKnowledgeBaseRequest {
207226
// Required. The name of the knowledge base to retrieve.
208-
// Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
227+
// Format `projects/<Project ID>/locations/<Location
228+
// ID>/knowledgeBases/<Knowledge Base ID>`.
209229
string name = 1 [
210230
(google.api.field_behavior) = REQUIRED,
211231
(google.api.resource_reference) = {
@@ -217,7 +237,7 @@ message GetKnowledgeBaseRequest {
217237
// Request message for [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBase].
218238
message CreateKnowledgeBaseRequest {
219239
// Required. The project to create a knowledge base for.
220-
// Format: `projects/<Project ID>`.
240+
// Format: `projects/<Project ID>/locations/<Location ID>`.
221241
string parent = 1 [
222242
(google.api.field_behavior) = REQUIRED,
223243
(google.api.resource_reference) = {
@@ -232,7 +252,8 @@ message CreateKnowledgeBaseRequest {
232252
// Request message for [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
233253
message DeleteKnowledgeBaseRequest {
234254
// Required. The name of the knowledge base to delete.
235-
// Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
255+
// Format: `projects/<Project ID>/locations/<Location
256+
// ID>/knowledgeBases/<Knowledge Base ID>`.
236257
string name = 1 [
237258
(google.api.field_behavior) = REQUIRED,
238259
(google.api.resource_reference) = {

protos/google/cloud/dialogflow/v2beta1/session.proto

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ service Sessions {
6060
// as a result. This method is not idempotent, because it may cause contexts
6161
// and session entity types to be updated, which in turn might affect
6262
// results of future queries.
63+
//
64+
// Note: Always use agent versions for production traffic.
65+
// See [Versions and
66+
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
6367
rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) {
6468
option (google.api.http) = {
6569
post: "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent"
@@ -83,6 +87,10 @@ service Sessions {
8387
// Processes a natural language query in audio format in a streaming fashion
8488
// and returns structured, actionable data as a result. This method is only
8589
// available via the gRPC API (not REST).
90+
//
91+
// Note: Always use agent versions for production traffic.
92+
// See [Versions and
93+
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
8694
rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) {
8795
}
8896
}
@@ -107,6 +115,10 @@ message DetectIntentRequest {
107115
// The length of the `Session ID` and `User ID` must not exceed 36 characters.
108116
// For more information, see the [API interactions
109117
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
118+
//
119+
// Note: Always use agent versions for production traffic.
120+
// See [Versions and
121+
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
110122
string session = 1 [
111123
(google.api.field_behavior) = REQUIRED,
112124
(google.api.resource_reference) = {
@@ -234,7 +246,7 @@ message QueryParameters {
234246
repeated SubAgent sub_agents = 13;
235247

236248
// This field can be used to pass HTTP headers for a webhook
237-
// call. These headers will be sent to webhook alone with the headers that
249+
// call. These headers will be sent to webhook along with the headers that
238250
// have been configured through Dialogflow web console. The headers defined
239251
// within this field will overwrite the headers configured through Dialogflow
240252
// console if there is a conflict. Header names are case-insensitive.
@@ -487,6 +499,10 @@ message StreamingDetectIntentRequest {
487499
//
488500
// For more information, see the [API interactions
489501
// guide](https://cloud.google.com/dialogflow/docs/api-overview).
502+
//
503+
// Note: Always use agent versions for production traffic.
504+
// See [Versions and
505+
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
490506
string session = 1 [
491507
(google.api.field_behavior) = REQUIRED,
492508
(google.api.resource_reference) = {

0 commit comments

Comments
 (0)