@google-cloud/discoveryengine 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
- package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
- package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
- package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
- package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
- package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
- package/build/protos/protos.d.ts +4390 -300
- package/build/protos/protos.js +13785 -2922
- package/build/protos/protos.json +1355 -14
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -21
- package/build/src/v1/completion_service_client.d.ts +313 -76
- package/build/src/v1/completion_service_client.js +451 -262
- package/build/src/v1/completion_service_proto_list.json +3 -0
- package/build/src/v1/control_service_client.d.ts +318 -81
- package/build/src/v1/control_service_client.js +422 -132
- package/build/src/v1/control_service_proto_list.json +3 -0
- package/build/src/v1/conversational_search_service_client.d.ts +341 -134
- package/build/src/v1/conversational_search_service_client.js +395 -223
- package/build/src/v1/conversational_search_service_client_config.json +5 -0
- package/build/src/v1/conversational_search_service_proto_list.json +3 -0
- package/build/src/v1/data_store_service_client.d.ts +359 -122
- package/build/src/v1/data_store_service_client.js +460 -280
- package/build/src/v1/data_store_service_proto_list.json +3 -0
- package/build/src/v1/document_service_client.d.ts +364 -121
- package/build/src/v1/document_service_client.js +469 -300
- package/build/src/v1/document_service_proto_list.json +3 -0
- package/build/src/v1/engine_service_client.d.ts +340 -103
- package/build/src/v1/engine_service_client.js +460 -279
- package/build/src/v1/engine_service_proto_list.json +3 -0
- package/build/src/v1/gapic_metadata.json +59 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
- package/build/src/v1/grounded_generation_service_client.js +405 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +3 -1
- package/build/src/v1/project_service_client.d.ts +313 -76
- package/build/src/v1/project_service_client.js +434 -222
- package/build/src/v1/project_service_proto_list.json +3 -0
- package/build/src/v1/rank_service_client.d.ts +285 -48
- package/build/src/v1/rank_service_client.js +398 -85
- package/build/src/v1/rank_service_proto_list.json +3 -0
- package/build/src/v1/recommendation_service_client.d.ts +142 -49
- package/build/src/v1/recommendation_service_client.js +198 -82
- package/build/src/v1/recommendation_service_proto_list.json +3 -0
- package/build/src/v1/schema_service_client.d.ts +348 -111
- package/build/src/v1/schema_service_client.js +457 -273
- package/build/src/v1/schema_service_proto_list.json +3 -0
- package/build/src/v1/search_service_client.d.ts +748 -559
- package/build/src/v1/search_service_client.js +302 -133
- package/build/src/v1/search_service_proto_list.json +3 -0
- package/build/src/v1/search_tuning_service_client.d.ts +314 -77
- package/build/src/v1/search_tuning_service_client.js +439 -235
- package/build/src/v1/search_tuning_service_proto_list.json +3 -0
- package/build/src/v1/serving_config_service_client.d.ts +1851 -0
- package/build/src/v1/serving_config_service_client.js +2642 -0
- package/build/src/v1/serving_config_service_client_config.json +30 -0
- package/build/src/v1/serving_config_service_proto_list.json +39 -0
- package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
- package/build/src/v1/site_search_engine_service_client.js +625 -351
- package/build/src/v1/site_search_engine_service_client_config.json +12 -0
- package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
- package/build/src/v1/user_event_service_client.d.ts +335 -86
- package/build/src/v1/user_event_service_client.js +447 -253
- package/build/src/v1/user_event_service_proto_list.json +3 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +82 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +92 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +134 -280
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +105 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +145 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +151 -316
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +156 -328
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +155 -325
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +143 -295
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +126 -262
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +81 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +79 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +144 -301
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +140 -292
- package/build/src/v1alpha/search_service_client.d.ts +327 -327
- package/build/src/v1alpha/search_service_client.js +88 -112
- package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1alpha/search_tuning_service_client.js +122 -253
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +97 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +130 -271
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +136 -279
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +103 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +143 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +141 -288
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +150 -309
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +153 -315
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +141 -285
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +86 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +115 -231
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +79 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +77 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +142 -291
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +104 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +138 -282
- package/build/src/v1beta/search_service_client.d.ts +665 -665
- package/build/src/v1beta/search_service_client.js +97 -128
- package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1beta/search_tuning_service_client.js +120 -243
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +95 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +186 -386
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +128 -261
- package/package.json +4 -4
@@ -18,6 +18,7 @@
|
|
18
18
|
// ** All changes to this file may be overwritten. **
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
20
20
|
exports.ConversationalSearchServiceClient = void 0;
|
21
|
+
const stream_1 = require("stream");
|
21
22
|
const jsonProtos = require("../../protos/protos.json");
|
22
23
|
const google_gax_1 = require("google-gax");
|
23
24
|
/**
|
@@ -96,28 +97,18 @@ class ConversationalSearchServiceClient {
|
|
96
97
|
*/
|
97
98
|
constructor(opts, gaxInstance) {
|
98
99
|
// Ensure that options include all the required fields.
|
99
|
-
const staticMembers = this
|
100
|
-
|
101
|
-
if (opts?.universe_domain &&
|
102
|
-
opts?.universeDomain &&
|
103
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
100
|
+
const staticMembers = this.constructor;
|
101
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
104
102
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
105
103
|
}
|
106
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
107
|
-
|
108
|
-
: undefined;
|
109
|
-
this._universeDomain =
|
110
|
-
opts?.universeDomain ??
|
111
|
-
opts?.universe_domain ??
|
112
|
-
universeDomainEnvVar ??
|
113
|
-
'googleapis.com';
|
104
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
105
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
114
106
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
115
107
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
116
108
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
117
109
|
const port = opts?.port || staticMembers.port;
|
118
110
|
const clientConfig = opts?.clientConfig ?? {};
|
119
|
-
const fallback = opts?.fallback ??
|
120
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
111
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
121
112
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
122
113
|
// Request numeric enum values if REST transport is used.
|
123
114
|
opts.numericEnums = true;
|
@@ -147,7 +138,10 @@ class ConversationalSearchServiceClient {
|
|
147
138
|
}
|
148
139
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
149
140
|
// Determine the client header string.
|
150
|
-
const clientHeader = [
|
141
|
+
const clientHeader = [
|
142
|
+
`gax/${this._gaxModule.version}`,
|
143
|
+
`gapic/${version}`,
|
144
|
+
];
|
151
145
|
if (typeof process === 'object' && 'versions' in process) {
|
152
146
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
153
147
|
}
|
@@ -183,6 +177,7 @@ class ConversationalSearchServiceClient {
|
|
183
177
|
projectLocationCollectionDataStoreSessionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}'),
|
184
178
|
projectLocationCollectionDataStoreSessionAnswerPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}'),
|
185
179
|
projectLocationCollectionDataStoreSiteSearchEnginePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine'),
|
180
|
+
projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}'),
|
186
181
|
projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}'),
|
187
182
|
projectLocationCollectionEngineControlPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}'),
|
188
183
|
projectLocationCollectionEngineConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}'),
|
@@ -201,6 +196,7 @@ class ConversationalSearchServiceClient {
|
|
201
196
|
projectLocationDataStoreSessionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}'),
|
202
197
|
projectLocationDataStoreSessionAnswerPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}'),
|
203
198
|
projectLocationDataStoreSiteSearchEnginePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine'),
|
199
|
+
projectLocationDataStoreSiteSearchEngineSitemapPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}'),
|
204
200
|
projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}'),
|
205
201
|
};
|
206
202
|
// Some of the methods on this service return "paged" results,
|
@@ -208,7 +204,12 @@ class ConversationalSearchServiceClient {
|
|
208
204
|
// pages). Denote the keys used for pagination and results.
|
209
205
|
this.descriptors.page = {
|
210
206
|
listConversations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'),
|
211
|
-
listSessions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions')
|
207
|
+
listSessions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions')
|
208
|
+
};
|
209
|
+
// Some of the methods on this service provide streaming responses.
|
210
|
+
// Provide descriptors for these.
|
211
|
+
this.descriptors.stream = {
|
212
|
+
streamAnswerQuery: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
|
212
213
|
};
|
213
214
|
// Put together the default options sent with requests.
|
214
215
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.ConversationalSearchService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -237,31 +238,23 @@ class ConversationalSearchServiceClient {
|
|
237
238
|
}
|
238
239
|
// Put together the "service stub" for
|
239
240
|
// google.cloud.discoveryengine.v1.ConversationalSearchService.
|
240
|
-
this.conversationalSearchServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
.ConversationalSearchService, this._opts, this._providedCustomServicePath);
|
241
|
+
this.conversationalSearchServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
242
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.ConversationalSearchService') :
|
243
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
|
+
this._protos.google.cloud.discoveryengine.v1.ConversationalSearchService, this._opts, this._providedCustomServicePath);
|
245
245
|
// Iterate over each of the methods that the service provides
|
246
246
|
// and create an API call method for each.
|
247
|
-
const conversationalSearchServiceStubMethods = [
|
248
|
-
'converseConversation',
|
249
|
-
'createConversation',
|
250
|
-
'deleteConversation',
|
251
|
-
'updateConversation',
|
252
|
-
'getConversation',
|
253
|
-
'listConversations',
|
254
|
-
'answerQuery',
|
255
|
-
'getAnswer',
|
256
|
-
'createSession',
|
257
|
-
'deleteSession',
|
258
|
-
'updateSession',
|
259
|
-
'getSession',
|
260
|
-
'listSessions',
|
261
|
-
];
|
247
|
+
const conversationalSearchServiceStubMethods = ['converseConversation', 'createConversation', 'deleteConversation', 'updateConversation', 'getConversation', 'listConversations', 'answerQuery', 'streamAnswerQuery', 'getAnswer', 'createSession', 'deleteSession', 'updateSession', 'getSession', 'listSessions'];
|
262
248
|
for (const methodName of conversationalSearchServiceStubMethods) {
|
263
249
|
const callPromise = this.conversationalSearchServiceStub.then(stub => (...args) => {
|
264
250
|
if (this._terminated) {
|
251
|
+
if (methodName in this.descriptors.stream) {
|
252
|
+
const stream = new stream_1.PassThrough({ objectMode: true });
|
253
|
+
setImmediate(() => {
|
254
|
+
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.'));
|
255
|
+
});
|
256
|
+
return stream;
|
257
|
+
}
|
265
258
|
return Promise.reject('The client has already been closed.');
|
266
259
|
}
|
267
260
|
const func = stub[methodName];
|
@@ -269,7 +262,9 @@ class ConversationalSearchServiceClient {
|
|
269
262
|
}, (err) => () => {
|
270
263
|
throw err;
|
271
264
|
});
|
272
|
-
const descriptor = this.descriptors.page[methodName] ||
|
265
|
+
const descriptor = this.descriptors.page[methodName] ||
|
266
|
+
this.descriptors.stream[methodName] ||
|
267
|
+
undefined;
|
273
268
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
274
269
|
this.innerApiCalls[methodName] = apiCall;
|
275
270
|
}
|
@@ -281,8 +276,7 @@ class ConversationalSearchServiceClient {
|
|
281
276
|
* @returns {string} The DNS address for this service.
|
282
277
|
*/
|
283
278
|
static get servicePath() {
|
284
|
-
if (typeof process === 'object' &&
|
285
|
-
typeof process.emitWarning === 'function') {
|
279
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
286
280
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
287
281
|
}
|
288
282
|
return 'discoveryengine.googleapis.com';
|
@@ -293,8 +287,7 @@ class ConversationalSearchServiceClient {
|
|
293
287
|
* @returns {string} The DNS address for this service.
|
294
288
|
*/
|
295
289
|
static get apiEndpoint() {
|
296
|
-
if (typeof process === 'object' &&
|
297
|
-
typeof process.emitWarning === 'function') {
|
290
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
298
291
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
299
292
|
}
|
300
293
|
return 'discoveryengine.googleapis.com';
|
@@ -322,7 +315,9 @@ class ConversationalSearchServiceClient {
|
|
322
315
|
* @returns {string[]} List of default scopes.
|
323
316
|
*/
|
324
317
|
static get scopes() {
|
325
|
-
return [
|
318
|
+
return [
|
319
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
320
|
+
];
|
326
321
|
}
|
327
322
|
/**
|
328
323
|
* Return the project ID used by this class.
|
@@ -348,13 +343,10 @@ class ConversationalSearchServiceClient {
|
|
348
343
|
options = options || {};
|
349
344
|
options.otherArgs = options.otherArgs || {};
|
350
345
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
351
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
352
|
-
|
353
|
-
name: request.name ?? '',
|
354
|
-
});
|
355
|
-
this.initialize().catch(err => {
|
356
|
-
throw err;
|
346
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
347
|
+
'name': request.name ?? '',
|
357
348
|
});
|
349
|
+
this.initialize().catch(err => { throw err; });
|
358
350
|
this._log.info('converseConversation request %j', request);
|
359
351
|
const wrappedCallback = callback
|
360
352
|
? (error, response, options, rawResponse) => {
|
@@ -362,8 +354,7 @@ class ConversationalSearchServiceClient {
|
|
362
354
|
callback(error, response, options, rawResponse); // We verified callback above.
|
363
355
|
}
|
364
356
|
: undefined;
|
365
|
-
return this.innerApiCalls
|
366
|
-
.converseConversation(request, options, wrappedCallback)
|
357
|
+
return this.innerApiCalls.converseConversation(request, options, wrappedCallback)
|
367
358
|
?.then(([response, options, rawResponse]) => {
|
368
359
|
this._log.info('converseConversation response %j', response);
|
369
360
|
return [response, options, rawResponse];
|
@@ -382,13 +373,10 @@ class ConversationalSearchServiceClient {
|
|
382
373
|
options = options || {};
|
383
374
|
options.otherArgs = options.otherArgs || {};
|
384
375
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
385
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
386
|
-
|
387
|
-
parent: request.parent ?? '',
|
388
|
-
});
|
389
|
-
this.initialize().catch(err => {
|
390
|
-
throw err;
|
376
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
377
|
+
'parent': request.parent ?? '',
|
391
378
|
});
|
379
|
+
this.initialize().catch(err => { throw err; });
|
392
380
|
this._log.info('createConversation request %j', request);
|
393
381
|
const wrappedCallback = callback
|
394
382
|
? (error, response, options, rawResponse) => {
|
@@ -396,8 +384,7 @@ class ConversationalSearchServiceClient {
|
|
396
384
|
callback(error, response, options, rawResponse); // We verified callback above.
|
397
385
|
}
|
398
386
|
: undefined;
|
399
|
-
return this.innerApiCalls
|
400
|
-
.createConversation(request, options, wrappedCallback)
|
387
|
+
return this.innerApiCalls.createConversation(request, options, wrappedCallback)
|
401
388
|
?.then(([response, options, rawResponse]) => {
|
402
389
|
this._log.info('createConversation response %j', response);
|
403
390
|
return [response, options, rawResponse];
|
@@ -416,13 +403,10 @@ class ConversationalSearchServiceClient {
|
|
416
403
|
options = options || {};
|
417
404
|
options.otherArgs = options.otherArgs || {};
|
418
405
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
419
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
420
|
-
|
421
|
-
name: request.name ?? '',
|
422
|
-
});
|
423
|
-
this.initialize().catch(err => {
|
424
|
-
throw err;
|
406
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
407
|
+
'name': request.name ?? '',
|
425
408
|
});
|
409
|
+
this.initialize().catch(err => { throw err; });
|
426
410
|
this._log.info('deleteConversation request %j', request);
|
427
411
|
const wrappedCallback = callback
|
428
412
|
? (error, response, options, rawResponse) => {
|
@@ -430,8 +414,7 @@ class ConversationalSearchServiceClient {
|
|
430
414
|
callback(error, response, options, rawResponse); // We verified callback above.
|
431
415
|
}
|
432
416
|
: undefined;
|
433
|
-
return this.innerApiCalls
|
434
|
-
.deleteConversation(request, options, wrappedCallback)
|
417
|
+
return this.innerApiCalls.deleteConversation(request, options, wrappedCallback)
|
435
418
|
?.then(([response, options, rawResponse]) => {
|
436
419
|
this._log.info('deleteConversation response %j', response);
|
437
420
|
return [response, options, rawResponse];
|
@@ -450,13 +433,10 @@ class ConversationalSearchServiceClient {
|
|
450
433
|
options = options || {};
|
451
434
|
options.otherArgs = options.otherArgs || {};
|
452
435
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
453
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
454
|
-
|
455
|
-
'conversation.name': request.conversation.name ?? '',
|
456
|
-
});
|
457
|
-
this.initialize().catch(err => {
|
458
|
-
throw err;
|
436
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
437
|
+
'conversation.name': request.conversation.name ?? '',
|
459
438
|
});
|
439
|
+
this.initialize().catch(err => { throw err; });
|
460
440
|
this._log.info('updateConversation request %j', request);
|
461
441
|
const wrappedCallback = callback
|
462
442
|
? (error, response, options, rawResponse) => {
|
@@ -464,8 +444,7 @@ class ConversationalSearchServiceClient {
|
|
464
444
|
callback(error, response, options, rawResponse); // We verified callback above.
|
465
445
|
}
|
466
446
|
: undefined;
|
467
|
-
return this.innerApiCalls
|
468
|
-
.updateConversation(request, options, wrappedCallback)
|
447
|
+
return this.innerApiCalls.updateConversation(request, options, wrappedCallback)
|
469
448
|
?.then(([response, options, rawResponse]) => {
|
470
449
|
this._log.info('updateConversation response %j', response);
|
471
450
|
return [response, options, rawResponse];
|
@@ -484,13 +463,10 @@ class ConversationalSearchServiceClient {
|
|
484
463
|
options = options || {};
|
485
464
|
options.otherArgs = options.otherArgs || {};
|
486
465
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
487
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
488
|
-
|
489
|
-
name: request.name ?? '',
|
490
|
-
});
|
491
|
-
this.initialize().catch(err => {
|
492
|
-
throw err;
|
466
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
467
|
+
'name': request.name ?? '',
|
493
468
|
});
|
469
|
+
this.initialize().catch(err => { throw err; });
|
494
470
|
this._log.info('getConversation request %j', request);
|
495
471
|
const wrappedCallback = callback
|
496
472
|
? (error, response, options, rawResponse) => {
|
@@ -498,8 +474,7 @@ class ConversationalSearchServiceClient {
|
|
498
474
|
callback(error, response, options, rawResponse); // We verified callback above.
|
499
475
|
}
|
500
476
|
: undefined;
|
501
|
-
return this.innerApiCalls
|
502
|
-
.getConversation(request, options, wrappedCallback)
|
477
|
+
return this.innerApiCalls.getConversation(request, options, wrappedCallback)
|
503
478
|
?.then(([response, options, rawResponse]) => {
|
504
479
|
this._log.info('getConversation response %j', response);
|
505
480
|
return [response, options, rawResponse];
|
@@ -518,13 +493,10 @@ class ConversationalSearchServiceClient {
|
|
518
493
|
options = options || {};
|
519
494
|
options.otherArgs = options.otherArgs || {};
|
520
495
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
521
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
522
|
-
|
523
|
-
serving_config: request.servingConfig ?? '',
|
524
|
-
});
|
525
|
-
this.initialize().catch(err => {
|
526
|
-
throw err;
|
496
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
497
|
+
'serving_config': request.servingConfig ?? '',
|
527
498
|
});
|
499
|
+
this.initialize().catch(err => { throw err; });
|
528
500
|
this._log.info('answerQuery request %j', request);
|
529
501
|
const wrappedCallback = callback
|
530
502
|
? (error, response, options, rawResponse) => {
|
@@ -532,8 +504,7 @@ class ConversationalSearchServiceClient {
|
|
532
504
|
callback(error, response, options, rawResponse); // We verified callback above.
|
533
505
|
}
|
534
506
|
: undefined;
|
535
|
-
return this.innerApiCalls
|
536
|
-
.answerQuery(request, options, wrappedCallback)
|
507
|
+
return this.innerApiCalls.answerQuery(request, options, wrappedCallback)
|
537
508
|
?.then(([response, options, rawResponse]) => {
|
538
509
|
this._log.info('answerQuery response %j', response);
|
539
510
|
return [response, options, rawResponse];
|
@@ -552,13 +523,10 @@ class ConversationalSearchServiceClient {
|
|
552
523
|
options = options || {};
|
553
524
|
options.otherArgs = options.otherArgs || {};
|
554
525
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
555
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
556
|
-
|
557
|
-
name: request.name ?? '',
|
558
|
-
});
|
559
|
-
this.initialize().catch(err => {
|
560
|
-
throw err;
|
526
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
527
|
+
'name': request.name ?? '',
|
561
528
|
});
|
529
|
+
this.initialize().catch(err => { throw err; });
|
562
530
|
this._log.info('getAnswer request %j', request);
|
563
531
|
const wrappedCallback = callback
|
564
532
|
? (error, response, options, rawResponse) => {
|
@@ -566,8 +534,7 @@ class ConversationalSearchServiceClient {
|
|
566
534
|
callback(error, response, options, rawResponse); // We verified callback above.
|
567
535
|
}
|
568
536
|
: undefined;
|
569
|
-
return this.innerApiCalls
|
570
|
-
.getAnswer(request, options, wrappedCallback)
|
537
|
+
return this.innerApiCalls.getAnswer(request, options, wrappedCallback)
|
571
538
|
?.then(([response, options, rawResponse]) => {
|
572
539
|
this._log.info('getAnswer response %j', response);
|
573
540
|
return [response, options, rawResponse];
|
@@ -586,13 +553,10 @@ class ConversationalSearchServiceClient {
|
|
586
553
|
options = options || {};
|
587
554
|
options.otherArgs = options.otherArgs || {};
|
588
555
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
589
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
590
|
-
|
591
|
-
parent: request.parent ?? '',
|
592
|
-
});
|
593
|
-
this.initialize().catch(err => {
|
594
|
-
throw err;
|
556
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
557
|
+
'parent': request.parent ?? '',
|
595
558
|
});
|
559
|
+
this.initialize().catch(err => { throw err; });
|
596
560
|
this._log.info('createSession request %j', request);
|
597
561
|
const wrappedCallback = callback
|
598
562
|
? (error, response, options, rawResponse) => {
|
@@ -600,8 +564,7 @@ class ConversationalSearchServiceClient {
|
|
600
564
|
callback(error, response, options, rawResponse); // We verified callback above.
|
601
565
|
}
|
602
566
|
: undefined;
|
603
|
-
return this.innerApiCalls
|
604
|
-
.createSession(request, options, wrappedCallback)
|
567
|
+
return this.innerApiCalls.createSession(request, options, wrappedCallback)
|
605
568
|
?.then(([response, options, rawResponse]) => {
|
606
569
|
this._log.info('createSession response %j', response);
|
607
570
|
return [response, options, rawResponse];
|
@@ -620,13 +583,10 @@ class ConversationalSearchServiceClient {
|
|
620
583
|
options = options || {};
|
621
584
|
options.otherArgs = options.otherArgs || {};
|
622
585
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
623
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
624
|
-
|
625
|
-
name: request.name ?? '',
|
626
|
-
});
|
627
|
-
this.initialize().catch(err => {
|
628
|
-
throw err;
|
586
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
587
|
+
'name': request.name ?? '',
|
629
588
|
});
|
589
|
+
this.initialize().catch(err => { throw err; });
|
630
590
|
this._log.info('deleteSession request %j', request);
|
631
591
|
const wrappedCallback = callback
|
632
592
|
? (error, response, options, rawResponse) => {
|
@@ -634,8 +594,7 @@ class ConversationalSearchServiceClient {
|
|
634
594
|
callback(error, response, options, rawResponse); // We verified callback above.
|
635
595
|
}
|
636
596
|
: undefined;
|
637
|
-
return this.innerApiCalls
|
638
|
-
.deleteSession(request, options, wrappedCallback)
|
597
|
+
return this.innerApiCalls.deleteSession(request, options, wrappedCallback)
|
639
598
|
?.then(([response, options, rawResponse]) => {
|
640
599
|
this._log.info('deleteSession response %j', response);
|
641
600
|
return [response, options, rawResponse];
|
@@ -654,13 +613,10 @@ class ConversationalSearchServiceClient {
|
|
654
613
|
options = options || {};
|
655
614
|
options.otherArgs = options.otherArgs || {};
|
656
615
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
657
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
658
|
-
|
659
|
-
'session.name': request.session.name ?? '',
|
660
|
-
});
|
661
|
-
this.initialize().catch(err => {
|
662
|
-
throw err;
|
616
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
617
|
+
'session.name': request.session.name ?? '',
|
663
618
|
});
|
619
|
+
this.initialize().catch(err => { throw err; });
|
664
620
|
this._log.info('updateSession request %j', request);
|
665
621
|
const wrappedCallback = callback
|
666
622
|
? (error, response, options, rawResponse) => {
|
@@ -668,8 +624,7 @@ class ConversationalSearchServiceClient {
|
|
668
624
|
callback(error, response, options, rawResponse); // We verified callback above.
|
669
625
|
}
|
670
626
|
: undefined;
|
671
|
-
return this.innerApiCalls
|
672
|
-
.updateSession(request, options, wrappedCallback)
|
627
|
+
return this.innerApiCalls.updateSession(request, options, wrappedCallback)
|
673
628
|
?.then(([response, options, rawResponse]) => {
|
674
629
|
this._log.info('updateSession response %j', response);
|
675
630
|
return [response, options, rawResponse];
|
@@ -688,13 +643,10 @@ class ConversationalSearchServiceClient {
|
|
688
643
|
options = options || {};
|
689
644
|
options.otherArgs = options.otherArgs || {};
|
690
645
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
691
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
692
|
-
|
693
|
-
name: request.name ?? '',
|
694
|
-
});
|
695
|
-
this.initialize().catch(err => {
|
696
|
-
throw err;
|
646
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
647
|
+
'name': request.name ?? '',
|
697
648
|
});
|
649
|
+
this.initialize().catch(err => { throw err; });
|
698
650
|
this._log.info('getSession request %j', request);
|
699
651
|
const wrappedCallback = callback
|
700
652
|
? (error, response, options, rawResponse) => {
|
@@ -702,13 +654,115 @@ class ConversationalSearchServiceClient {
|
|
702
654
|
callback(error, response, options, rawResponse); // We verified callback above.
|
703
655
|
}
|
704
656
|
: undefined;
|
705
|
-
return this.innerApiCalls
|
706
|
-
.getSession(request, options, wrappedCallback)
|
657
|
+
return this.innerApiCalls.getSession(request, options, wrappedCallback)
|
707
658
|
?.then(([response, options, rawResponse]) => {
|
708
659
|
this._log.info('getSession response %j', response);
|
709
660
|
return [response, options, rawResponse];
|
710
661
|
});
|
711
662
|
}
|
663
|
+
/**
|
664
|
+
* Answer query method (streaming).
|
665
|
+
*
|
666
|
+
* It takes one
|
667
|
+
* {@link protos.google.cloud.discoveryengine.v1.AnswerQueryRequest|AnswerQueryRequest}
|
668
|
+
* and returns multiple
|
669
|
+
* {@link protos.google.cloud.discoveryengine.v1.AnswerQueryResponse|AnswerQueryResponse}
|
670
|
+
* messages in a stream.
|
671
|
+
*
|
672
|
+
* @param {Object} request
|
673
|
+
* The request object that will be sent.
|
674
|
+
* @param {string} request.servingConfig
|
675
|
+
* Required. The resource name of the Search serving config, such as
|
676
|
+
* `projects/* /locations/global/collections/default_collection/engines/* /servingConfigs/default_serving_config`,
|
677
|
+
* or
|
678
|
+
* `projects/* /locations/global/collections/default_collection/dataStores/* /servingConfigs/default_serving_config`.
|
679
|
+
* This field is used to identify the serving configuration name, set
|
680
|
+
* of models used to make the search.
|
681
|
+
* @param {google.cloud.discoveryengine.v1.Query} request.query
|
682
|
+
* Required. Current user query.
|
683
|
+
* @param {string} request.session
|
684
|
+
* The session resource name. Not required.
|
685
|
+
*
|
686
|
+
* When session field is not set, the API is in sessionless mode.
|
687
|
+
*
|
688
|
+
* We support auto session mode: users can use the wildcard symbol `-` as
|
689
|
+
* session ID. A new ID will be automatically generated and assigned.
|
690
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec} request.safetySpec
|
691
|
+
* Model specification.
|
692
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec} request.relatedQuestionsSpec
|
693
|
+
* Related questions specification.
|
694
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec} [request.groundingSpec]
|
695
|
+
* Optional. Grounding specification.
|
696
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec} request.answerGenerationSpec
|
697
|
+
* Answer generation specification.
|
698
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec} request.searchSpec
|
699
|
+
* Search specification.
|
700
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec} request.queryUnderstandingSpec
|
701
|
+
* Query understanding specification.
|
702
|
+
* @param {boolean} request.asynchronousMode
|
703
|
+
* Deprecated: This field is deprecated. Streaming Answer API will be
|
704
|
+
* supported.
|
705
|
+
*
|
706
|
+
* Asynchronous mode control.
|
707
|
+
*
|
708
|
+
* If enabled, the response will be returned with answer/session resource
|
709
|
+
* name without final answer. The API users need to do the polling to get
|
710
|
+
* the latest status of answer/session by calling
|
711
|
+
* {@link protos.google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer|ConversationalSearchService.GetAnswer}
|
712
|
+
* or
|
713
|
+
* {@link protos.google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession|ConversationalSearchService.GetSession}
|
714
|
+
* method.
|
715
|
+
* @param {string} request.userPseudoId
|
716
|
+
* A unique identifier for tracking visitors. For example, this could be
|
717
|
+
* implemented with an HTTP cookie, which should be able to uniquely identify
|
718
|
+
* a visitor on a single device. This unique identifier should not change if
|
719
|
+
* the visitor logs in or out of the website.
|
720
|
+
*
|
721
|
+
* This field should NOT have a fixed value such as `unknown_visitor`.
|
722
|
+
*
|
723
|
+
* The field must be a UTF-8 encoded string with a length limit of 128
|
724
|
+
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
725
|
+
* @param {number[]} request.userLabels
|
726
|
+
* The user labels applied to a resource must meet the following requirements:
|
727
|
+
*
|
728
|
+
* * Each resource can have multiple labels, up to a maximum of 64.
|
729
|
+
* * Each label must be a key-value pair.
|
730
|
+
* * Keys have a minimum length of 1 character and a maximum length of 63
|
731
|
+
* characters and cannot be empty. Values can be empty and have a maximum
|
732
|
+
* length of 63 characters.
|
733
|
+
* * Keys and values can contain only lowercase letters, numeric characters,
|
734
|
+
* underscores, and dashes. All characters must use UTF-8 encoding, and
|
735
|
+
* international characters are allowed.
|
736
|
+
* * The key portion of a label must be unique. However, you can use the same
|
737
|
+
* key with multiple resources.
|
738
|
+
* * Keys must start with a lowercase letter or international character.
|
739
|
+
*
|
740
|
+
* See [Google Cloud
|
741
|
+
* Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
742
|
+
* for more details.
|
743
|
+
* @param {google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec} [request.endUserSpec]
|
744
|
+
* Optional. End user specification.
|
745
|
+
* @param {object} [options]
|
746
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
747
|
+
* @returns {Stream}
|
748
|
+
* An object stream which emits {@link protos.google.cloud.discoveryengine.v1.AnswerQueryResponse|AnswerQueryResponse} on 'data' event.
|
749
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
750
|
+
* for more details and examples.
|
751
|
+
* @example <caption>include:samples/generated/v1/conversational_search_service.stream_answer_query.js</caption>
|
752
|
+
* region_tag:discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_async
|
753
|
+
*/
|
754
|
+
streamAnswerQuery(request, options) {
|
755
|
+
request = request || {};
|
756
|
+
options = options || {};
|
757
|
+
options.otherArgs = options.otherArgs || {};
|
758
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
759
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
760
|
+
'serving_config': request.servingConfig ?? '',
|
761
|
+
});
|
762
|
+
this.initialize().catch(err => { throw err; });
|
763
|
+
this._log.info('streamAnswerQuery stream %j', options);
|
764
|
+
return this.innerApiCalls.streamAnswerQuery(request, options);
|
765
|
+
}
|
712
766
|
listConversations(request, optionsOrCallback, callback) {
|
713
767
|
request = request || {};
|
714
768
|
let options;
|
@@ -722,13 +776,10 @@ class ConversationalSearchServiceClient {
|
|
722
776
|
options = options || {};
|
723
777
|
options.otherArgs = options.otherArgs || {};
|
724
778
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
725
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
726
|
-
|
727
|
-
parent: request.parent ?? '',
|
728
|
-
});
|
729
|
-
this.initialize().catch(err => {
|
730
|
-
throw err;
|
779
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
780
|
+
'parent': request.parent ?? '',
|
731
781
|
});
|
782
|
+
this.initialize().catch(err => { throw err; });
|
732
783
|
const wrappedCallback = callback
|
733
784
|
? (error, values, nextPageRequest, rawResponse) => {
|
734
785
|
this._log.info('listConversations values %j', values);
|
@@ -789,15 +840,12 @@ class ConversationalSearchServiceClient {
|
|
789
840
|
options = options || {};
|
790
841
|
options.otherArgs = options.otherArgs || {};
|
791
842
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
792
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
793
|
-
|
794
|
-
|
795
|
-
});
|
843
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
844
|
+
'parent': request.parent ?? '',
|
845
|
+
});
|
796
846
|
const defaultCallSettings = this._defaults['listConversations'];
|
797
847
|
const callSettings = defaultCallSettings.merge(options);
|
798
|
-
this.initialize().catch(err => {
|
799
|
-
throw err;
|
800
|
-
});
|
848
|
+
this.initialize().catch(err => { throw err; });
|
801
849
|
this._log.info('listConversations stream %j', request);
|
802
850
|
return this.descriptors.page.listConversations.createStream(this.innerApiCalls.listConversations, request, callSettings);
|
803
851
|
}
|
@@ -850,15 +898,12 @@ class ConversationalSearchServiceClient {
|
|
850
898
|
options = options || {};
|
851
899
|
options.otherArgs = options.otherArgs || {};
|
852
900
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
853
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
854
|
-
|
855
|
-
|
856
|
-
});
|
901
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
902
|
+
'parent': request.parent ?? '',
|
903
|
+
});
|
857
904
|
const defaultCallSettings = this._defaults['listConversations'];
|
858
905
|
const callSettings = defaultCallSettings.merge(options);
|
859
|
-
this.initialize().catch(err => {
|
860
|
-
throw err;
|
861
|
-
});
|
906
|
+
this.initialize().catch(err => { throw err; });
|
862
907
|
this._log.info('listConversations iterate %j', request);
|
863
908
|
return this.descriptors.page.listConversations.asyncIterate(this.innerApiCalls['listConversations'], request, callSettings);
|
864
909
|
}
|
@@ -875,13 +920,10 @@ class ConversationalSearchServiceClient {
|
|
875
920
|
options = options || {};
|
876
921
|
options.otherArgs = options.otherArgs || {};
|
877
922
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
878
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
879
|
-
|
880
|
-
parent: request.parent ?? '',
|
881
|
-
});
|
882
|
-
this.initialize().catch(err => {
|
883
|
-
throw err;
|
923
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
924
|
+
'parent': request.parent ?? '',
|
884
925
|
});
|
926
|
+
this.initialize().catch(err => { throw err; });
|
885
927
|
const wrappedCallback = callback
|
886
928
|
? (error, values, nextPageRequest, rawResponse) => {
|
887
929
|
this._log.info('listSessions values %j', values);
|
@@ -919,13 +961,18 @@ class ConversationalSearchServiceClient {
|
|
919
961
|
* A comma-separated list of fields to order by, sorted in ascending order.
|
920
962
|
* Use "desc" after a field name for descending.
|
921
963
|
* Supported fields:
|
964
|
+
*
|
922
965
|
* * `update_time`
|
923
966
|
* * `create_time`
|
924
967
|
* * `session_name`
|
968
|
+
* * `is_pinned`
|
925
969
|
*
|
926
970
|
* Example:
|
927
|
-
*
|
928
|
-
* "
|
971
|
+
*
|
972
|
+
* * "update_time desc"
|
973
|
+
* * "create_time"
|
974
|
+
* * "is_pinned desc,update_time desc": list sessions by is_pinned first, then
|
975
|
+
* by update_time.
|
929
976
|
* @param {object} [options]
|
930
977
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
931
978
|
* @returns {Stream}
|
@@ -942,15 +989,12 @@ class ConversationalSearchServiceClient {
|
|
942
989
|
options = options || {};
|
943
990
|
options.otherArgs = options.otherArgs || {};
|
944
991
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
945
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
946
|
-
|
947
|
-
|
948
|
-
});
|
992
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
993
|
+
'parent': request.parent ?? '',
|
994
|
+
});
|
949
995
|
const defaultCallSettings = this._defaults['listSessions'];
|
950
996
|
const callSettings = defaultCallSettings.merge(options);
|
951
|
-
this.initialize().catch(err => {
|
952
|
-
throw err;
|
953
|
-
});
|
997
|
+
this.initialize().catch(err => { throw err; });
|
954
998
|
this._log.info('listSessions stream %j', request);
|
955
999
|
return this.descriptors.page.listSessions.createStream(this.innerApiCalls.listSessions, request, callSettings);
|
956
1000
|
}
|
@@ -979,13 +1023,18 @@ class ConversationalSearchServiceClient {
|
|
979
1023
|
* A comma-separated list of fields to order by, sorted in ascending order.
|
980
1024
|
* Use "desc" after a field name for descending.
|
981
1025
|
* Supported fields:
|
1026
|
+
*
|
982
1027
|
* * `update_time`
|
983
1028
|
* * `create_time`
|
984
1029
|
* * `session_name`
|
1030
|
+
* * `is_pinned`
|
985
1031
|
*
|
986
1032
|
* Example:
|
987
|
-
*
|
988
|
-
* "
|
1033
|
+
*
|
1034
|
+
* * "update_time desc"
|
1035
|
+
* * "create_time"
|
1036
|
+
* * "is_pinned desc,update_time desc": list sessions by is_pinned first, then
|
1037
|
+
* by update_time.
|
989
1038
|
* @param {object} [options]
|
990
1039
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
991
1040
|
* @returns {Object}
|
@@ -1003,70 +1052,67 @@ class ConversationalSearchServiceClient {
|
|
1003
1052
|
options = options || {};
|
1004
1053
|
options.otherArgs = options.otherArgs || {};
|
1005
1054
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
1006
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
1007
|
-
|
1008
|
-
|
1009
|
-
});
|
1055
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
1056
|
+
'parent': request.parent ?? '',
|
1057
|
+
});
|
1010
1058
|
const defaultCallSettings = this._defaults['listSessions'];
|
1011
1059
|
const callSettings = defaultCallSettings.merge(options);
|
1012
|
-
this.initialize().catch(err => {
|
1013
|
-
throw err;
|
1014
|
-
});
|
1060
|
+
this.initialize().catch(err => { throw err; });
|
1015
1061
|
this._log.info('listSessions iterate %j', request);
|
1016
1062
|
return this.descriptors.page.listSessions.asyncIterate(this.innerApiCalls['listSessions'], request, callSettings);
|
1017
1063
|
}
|
1018
1064
|
/**
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1065
|
+
* Gets information about a location.
|
1066
|
+
*
|
1067
|
+
* @param {Object} request
|
1068
|
+
* The request object that will be sent.
|
1069
|
+
* @param {string} request.name
|
1070
|
+
* Resource name for the location.
|
1071
|
+
* @param {object} [options]
|
1072
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
1073
|
+
* @returns {Promise} - The promise which resolves to an array.
|
1074
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
1075
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
1076
|
+
* for more details and examples.
|
1077
|
+
* @example
|
1078
|
+
* ```
|
1079
|
+
* const [response] = await client.getLocation(request);
|
1080
|
+
* ```
|
1081
|
+
*/
|
1036
1082
|
getLocation(request, options, callback) {
|
1037
1083
|
return this.locationsClient.getLocation(request, options, callback);
|
1038
1084
|
}
|
1039
1085
|
/**
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1086
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
1087
|
+
*
|
1088
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
1089
|
+
* @param {Object} request
|
1090
|
+
* The request object that will be sent.
|
1091
|
+
* @param {string} request.name
|
1092
|
+
* The resource that owns the locations collection, if applicable.
|
1093
|
+
* @param {string} request.filter
|
1094
|
+
* The standard list filter.
|
1095
|
+
* @param {number} request.pageSize
|
1096
|
+
* The standard list page size.
|
1097
|
+
* @param {string} request.pageToken
|
1098
|
+
* The standard list page token.
|
1099
|
+
* @param {object} [options]
|
1100
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
1101
|
+
* @returns {Object}
|
1102
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
1103
|
+
* When you iterate the returned iterable, each element will be an object representing
|
1104
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
1105
|
+
* so you can stop the iteration when you don't need more results.
|
1106
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
1107
|
+
* for more details and examples.
|
1108
|
+
* @example
|
1109
|
+
* ```
|
1110
|
+
* const iterable = client.listLocationsAsync(request);
|
1111
|
+
* for await (const response of iterable) {
|
1112
|
+
* // process response
|
1113
|
+
* }
|
1114
|
+
* ```
|
1115
|
+
*/
|
1070
1116
|
listLocationsAsync(request, options) {
|
1071
1117
|
return this.locationsClient.listLocationsAsync(request, options);
|
1072
1118
|
}
|
@@ -1991,6 +2037,75 @@ class ConversationalSearchServiceClient {
|
|
1991
2037
|
matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineName(projectLocationCollectionDataStoreSiteSearchEngineName) {
|
1992
2038
|
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineName).data_store;
|
1993
2039
|
}
|
2040
|
+
/**
|
2041
|
+
* Return a fully-qualified projectLocationCollectionDataStoreSiteSearchEngineSitemap resource name string.
|
2042
|
+
*
|
2043
|
+
* @param {string} project
|
2044
|
+
* @param {string} location
|
2045
|
+
* @param {string} collection
|
2046
|
+
* @param {string} data_store
|
2047
|
+
* @param {string} sitemap
|
2048
|
+
* @returns {string} Resource name string.
|
2049
|
+
*/
|
2050
|
+
projectLocationCollectionDataStoreSiteSearchEngineSitemapPath(project, location, collection, dataStore, sitemap) {
|
2051
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.render({
|
2052
|
+
project: project,
|
2053
|
+
location: location,
|
2054
|
+
collection: collection,
|
2055
|
+
data_store: dataStore,
|
2056
|
+
sitemap: sitemap,
|
2057
|
+
});
|
2058
|
+
}
|
2059
|
+
/**
|
2060
|
+
* Parse the project from ProjectLocationCollectionDataStoreSiteSearchEngineSitemap resource.
|
2061
|
+
*
|
2062
|
+
* @param {string} projectLocationCollectionDataStoreSiteSearchEngineSitemapName
|
2063
|
+
* A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_sitemap resource.
|
2064
|
+
* @returns {string} A string representing the project.
|
2065
|
+
*/
|
2066
|
+
matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineSitemapName(projectLocationCollectionDataStoreSiteSearchEngineSitemapName) {
|
2067
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineSitemapName).project;
|
2068
|
+
}
|
2069
|
+
/**
|
2070
|
+
* Parse the location from ProjectLocationCollectionDataStoreSiteSearchEngineSitemap resource.
|
2071
|
+
*
|
2072
|
+
* @param {string} projectLocationCollectionDataStoreSiteSearchEngineSitemapName
|
2073
|
+
* A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_sitemap resource.
|
2074
|
+
* @returns {string} A string representing the location.
|
2075
|
+
*/
|
2076
|
+
matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineSitemapName(projectLocationCollectionDataStoreSiteSearchEngineSitemapName) {
|
2077
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineSitemapName).location;
|
2078
|
+
}
|
2079
|
+
/**
|
2080
|
+
* Parse the collection from ProjectLocationCollectionDataStoreSiteSearchEngineSitemap resource.
|
2081
|
+
*
|
2082
|
+
* @param {string} projectLocationCollectionDataStoreSiteSearchEngineSitemapName
|
2083
|
+
* A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_sitemap resource.
|
2084
|
+
* @returns {string} A string representing the collection.
|
2085
|
+
*/
|
2086
|
+
matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineSitemapName(projectLocationCollectionDataStoreSiteSearchEngineSitemapName) {
|
2087
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineSitemapName).collection;
|
2088
|
+
}
|
2089
|
+
/**
|
2090
|
+
* Parse the data_store from ProjectLocationCollectionDataStoreSiteSearchEngineSitemap resource.
|
2091
|
+
*
|
2092
|
+
* @param {string} projectLocationCollectionDataStoreSiteSearchEngineSitemapName
|
2093
|
+
* A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_sitemap resource.
|
2094
|
+
* @returns {string} A string representing the data_store.
|
2095
|
+
*/
|
2096
|
+
matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineSitemapName(projectLocationCollectionDataStoreSiteSearchEngineSitemapName) {
|
2097
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineSitemapName).data_store;
|
2098
|
+
}
|
2099
|
+
/**
|
2100
|
+
* Parse the sitemap from ProjectLocationCollectionDataStoreSiteSearchEngineSitemap resource.
|
2101
|
+
*
|
2102
|
+
* @param {string} projectLocationCollectionDataStoreSiteSearchEngineSitemapName
|
2103
|
+
* A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_sitemap resource.
|
2104
|
+
* @returns {string} A string representing the sitemap.
|
2105
|
+
*/
|
2106
|
+
matchSitemapFromProjectLocationCollectionDataStoreSiteSearchEngineSitemapName(projectLocationCollectionDataStoreSiteSearchEngineSitemapName) {
|
2107
|
+
return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationCollectionDataStoreSiteSearchEngineSitemapName).sitemap;
|
2108
|
+
}
|
1994
2109
|
/**
|
1995
2110
|
* Return a fully-qualified projectLocationCollectionDataStoreSiteSearchEngineTargetSite resource name string.
|
1996
2111
|
*
|
@@ -3113,6 +3228,63 @@ class ConversationalSearchServiceClient {
|
|
3113
3228
|
matchDataStoreFromProjectLocationDataStoreSiteSearchEngineName(projectLocationDataStoreSiteSearchEngineName) {
|
3114
3229
|
return this.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.match(projectLocationDataStoreSiteSearchEngineName).data_store;
|
3115
3230
|
}
|
3231
|
+
/**
|
3232
|
+
* Return a fully-qualified projectLocationDataStoreSiteSearchEngineSitemap resource name string.
|
3233
|
+
*
|
3234
|
+
* @param {string} project
|
3235
|
+
* @param {string} location
|
3236
|
+
* @param {string} data_store
|
3237
|
+
* @param {string} sitemap
|
3238
|
+
* @returns {string} Resource name string.
|
3239
|
+
*/
|
3240
|
+
projectLocationDataStoreSiteSearchEngineSitemapPath(project, location, dataStore, sitemap) {
|
3241
|
+
return this.pathTemplates.projectLocationDataStoreSiteSearchEngineSitemapPathTemplate.render({
|
3242
|
+
project: project,
|
3243
|
+
location: location,
|
3244
|
+
data_store: dataStore,
|
3245
|
+
sitemap: sitemap,
|
3246
|
+
});
|
3247
|
+
}
|
3248
|
+
/**
|
3249
|
+
* Parse the project from ProjectLocationDataStoreSiteSearchEngineSitemap resource.
|
3250
|
+
*
|
3251
|
+
* @param {string} projectLocationDataStoreSiteSearchEngineSitemapName
|
3252
|
+
* A fully-qualified path representing project_location_data_store_siteSearchEngine_sitemap resource.
|
3253
|
+
* @returns {string} A string representing the project.
|
3254
|
+
*/
|
3255
|
+
matchProjectFromProjectLocationDataStoreSiteSearchEngineSitemapName(projectLocationDataStoreSiteSearchEngineSitemapName) {
|
3256
|
+
return this.pathTemplates.projectLocationDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationDataStoreSiteSearchEngineSitemapName).project;
|
3257
|
+
}
|
3258
|
+
/**
|
3259
|
+
* Parse the location from ProjectLocationDataStoreSiteSearchEngineSitemap resource.
|
3260
|
+
*
|
3261
|
+
* @param {string} projectLocationDataStoreSiteSearchEngineSitemapName
|
3262
|
+
* A fully-qualified path representing project_location_data_store_siteSearchEngine_sitemap resource.
|
3263
|
+
* @returns {string} A string representing the location.
|
3264
|
+
*/
|
3265
|
+
matchLocationFromProjectLocationDataStoreSiteSearchEngineSitemapName(projectLocationDataStoreSiteSearchEngineSitemapName) {
|
3266
|
+
return this.pathTemplates.projectLocationDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationDataStoreSiteSearchEngineSitemapName).location;
|
3267
|
+
}
|
3268
|
+
/**
|
3269
|
+
* Parse the data_store from ProjectLocationDataStoreSiteSearchEngineSitemap resource.
|
3270
|
+
*
|
3271
|
+
* @param {string} projectLocationDataStoreSiteSearchEngineSitemapName
|
3272
|
+
* A fully-qualified path representing project_location_data_store_siteSearchEngine_sitemap resource.
|
3273
|
+
* @returns {string} A string representing the data_store.
|
3274
|
+
*/
|
3275
|
+
matchDataStoreFromProjectLocationDataStoreSiteSearchEngineSitemapName(projectLocationDataStoreSiteSearchEngineSitemapName) {
|
3276
|
+
return this.pathTemplates.projectLocationDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationDataStoreSiteSearchEngineSitemapName).data_store;
|
3277
|
+
}
|
3278
|
+
/**
|
3279
|
+
* Parse the sitemap from ProjectLocationDataStoreSiteSearchEngineSitemap resource.
|
3280
|
+
*
|
3281
|
+
* @param {string} projectLocationDataStoreSiteSearchEngineSitemapName
|
3282
|
+
* A fully-qualified path representing project_location_data_store_siteSearchEngine_sitemap resource.
|
3283
|
+
* @returns {string} A string representing the sitemap.
|
3284
|
+
*/
|
3285
|
+
matchSitemapFromProjectLocationDataStoreSiteSearchEngineSitemapName(projectLocationDataStoreSiteSearchEngineSitemapName) {
|
3286
|
+
return this.pathTemplates.projectLocationDataStoreSiteSearchEngineSitemapPathTemplate.match(projectLocationDataStoreSiteSearchEngineSitemapName).sitemap;
|
3287
|
+
}
|
3116
3288
|
/**
|
3117
3289
|
* Return a fully-qualified projectLocationDataStoreSiteSearchEngineTargetSite resource name string.
|
3118
3290
|
*
|
@@ -3182,7 +3354,7 @@ class ConversationalSearchServiceClient {
|
|
3182
3354
|
this._log.info('ending gRPC channel');
|
3183
3355
|
this._terminated = true;
|
3184
3356
|
stub.close();
|
3185
|
-
this.locationsClient.close();
|
3357
|
+
this.locationsClient.close().catch(err => { throw err; });
|
3186
3358
|
});
|
3187
3359
|
}
|
3188
3360
|
return Promise.resolve();
|