@google-cloud/discoveryengine 2.1.0 → 2.3.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/README.md +13 -0
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
- package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
- package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
- package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
- package/build/protos/protos.d.ts +5415 -578
- package/build/protos/protos.js +77830 -63391
- package/build/protos/protos.json +1537 -92
- package/build/src/index.d.ts +10 -1
- package/build/src/index.js +8 -22
- package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
- package/build/src/v1/cmek_config_service_client.js +3274 -0
- package/build/src/v1/cmek_config_service_client_config.json +42 -0
- package/build/src/v1/cmek_config_service_proto_list.json +44 -0
- package/build/src/v1/completion_service_client.d.ts +166 -76
- package/build/src/v1/completion_service_client.js +258 -263
- package/build/src/v1/completion_service_proto_list.json +6 -1
- package/build/src/v1/control_service_client.d.ts +171 -81
- package/build/src/v1/control_service_client.js +246 -132
- package/build/src/v1/control_service_proto_list.json +6 -1
- package/build/src/v1/conversational_search_service_client.d.ts +233 -143
- package/build/src/v1/conversational_search_service_client.js +330 -226
- package/build/src/v1/conversational_search_service_proto_list.json +6 -1
- package/build/src/v1/data_store_service_client.d.ts +218 -122
- package/build/src/v1/data_store_service_client.js +273 -281
- package/build/src/v1/data_store_service_proto_list.json +6 -1
- package/build/src/v1/document_service_client.d.ts +210 -120
- package/build/src/v1/document_service_client.js +300 -301
- package/build/src/v1/document_service_proto_list.json +6 -1
- package/build/src/v1/engine_service_client.d.ts +193 -103
- package/build/src/v1/engine_service_client.js +273 -280
- package/build/src/v1/engine_service_proto_list.json +6 -1
- package/build/src/v1/gapic_metadata.json +184 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
- package/build/src/v1/grounded_generation_service_client.js +217 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
- package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
- package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
- package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
- package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
- package/build/src/v1/index.d.ts +3 -0
- package/build/src/v1/index.js +7 -1
- package/build/src/v1/project_service_client.d.ts +166 -76
- package/build/src/v1/project_service_client.js +235 -223
- package/build/src/v1/project_service_proto_list.json +6 -1
- package/build/src/v1/rank_service_client.d.ts +137 -47
- package/build/src/v1/rank_service_client.js +204 -85
- package/build/src/v1/rank_service_proto_list.json +6 -1
- package/build/src/v1/recommendation_service_client.d.ts +137 -47
- package/build/src/v1/recommendation_service_client.js +202 -82
- package/build/src/v1/recommendation_service_proto_list.json +6 -1
- package/build/src/v1/schema_service_client.d.ts +201 -111
- package/build/src/v1/schema_service_client.js +264 -274
- package/build/src/v1/schema_service_proto_list.json +6 -1
- package/build/src/v1/search_service_client.d.ts +661 -571
- package/build/src/v1/search_service_client.js +216 -113
- package/build/src/v1/search_service_proto_list.json +6 -1
- package/build/src/v1/search_tuning_service_client.d.ts +167 -77
- package/build/src/v1/search_tuning_service_client.js +246 -236
- package/build/src/v1/search_tuning_service_proto_list.json +6 -1
- package/build/src/v1/serving_config_service_client.d.ts +138 -48
- package/build/src/v1/serving_config_service_client.js +201 -80
- package/build/src/v1/serving_config_service_proto_list.json +6 -1
- package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
- package/build/src/v1/site_search_engine_service_client.js +324 -379
- package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
- package/build/src/v1/user_event_service_client.d.ts +167 -77
- package/build/src/v1/user_event_service_client.js +260 -254
- package/build/src/v1/user_event_service_proto_list.json +6 -1
- package/build/src/v1/user_license_service_client.d.ts +2256 -0
- package/build/src/v1/user_license_service_client.js +3194 -0
- package/build/src/v1/user_license_service_client_config.json +34 -0
- package/build/src/v1/user_license_service_proto_list.json +44 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +94 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +98 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +141 -281
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +129 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +211 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +176 -317
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +193 -329
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +180 -326
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +150 -296
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +139 -263
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +87 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +85 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +169 -302
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +147 -293
- 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 +129 -254
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +109 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +143 -272
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +149 -280
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +127 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +209 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +154 -289
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +181 -310
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +178 -316
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +148 -286
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +98 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +116 -232
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +85 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +83 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +167 -292
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +128 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +145 -283
- 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 +127 -244
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +107 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +205 -387
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +141 -262
- package/package.json +7 -7
- package/CHANGELOG.md +0 -267
@@ -97,28 +97,18 @@ class GroundedGenerationServiceClient {
|
|
97
97
|
*/
|
98
98
|
constructor(opts, gaxInstance) {
|
99
99
|
// Ensure that options include all the required fields.
|
100
|
-
const staticMembers = this
|
101
|
-
|
102
|
-
if (opts?.universe_domain &&
|
103
|
-
opts?.universeDomain &&
|
104
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
100
|
+
const staticMembers = this.constructor;
|
101
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
105
102
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
106
103
|
}
|
107
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
108
|
-
|
109
|
-
: undefined;
|
110
|
-
this._universeDomain =
|
111
|
-
opts?.universeDomain ??
|
112
|
-
opts?.universe_domain ??
|
113
|
-
universeDomainEnvVar ??
|
114
|
-
'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';
|
115
106
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
116
107
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
117
108
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
118
109
|
const port = opts?.port || staticMembers.port;
|
119
110
|
const clientConfig = opts?.clientConfig ?? {};
|
120
|
-
const fallback = opts?.fallback ??
|
121
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
111
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
122
112
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
123
113
|
// Request numeric enum values if REST transport is used.
|
124
114
|
opts.numericEnums = true;
|
@@ -148,7 +138,10 @@ class GroundedGenerationServiceClient {
|
|
148
138
|
}
|
149
139
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
150
140
|
// Determine the client header string.
|
151
|
-
const clientHeader = [
|
141
|
+
const clientHeader = [
|
142
|
+
`gax/${this._gaxModule.version}`,
|
143
|
+
`gapic/${version}`,
|
144
|
+
];
|
152
145
|
if (typeof process === 'object' && 'versions' in process) {
|
153
146
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
154
147
|
}
|
@@ -172,8 +165,11 @@ class GroundedGenerationServiceClient {
|
|
172
165
|
this.pathTemplates = {
|
173
166
|
enginePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/engines/{engine}'),
|
174
167
|
groundingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/groundingConfigs/{grounding_config}'),
|
168
|
+
identityMappingStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}'),
|
175
169
|
locationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}'),
|
176
170
|
projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
|
171
|
+
projectLocationCmekConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/cmekConfig'),
|
172
|
+
projectLocationCmekConfigsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/cmekConfigs/{cmek_config}'),
|
177
173
|
projectLocationCollectionDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}'),
|
178
174
|
projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
|
179
175
|
projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}'),
|
@@ -211,7 +207,7 @@ class GroundedGenerationServiceClient {
|
|
211
207
|
// Some of the methods on this service provide streaming responses.
|
212
208
|
// Provide descriptors for these.
|
213
209
|
this.descriptors.stream = {
|
214
|
-
streamGenerateGroundedContent: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
|
210
|
+
streamGenerateGroundedContent: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
|
215
211
|
};
|
216
212
|
// Put together the default options sent with requests.
|
217
213
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.GroundedGenerationService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -240,18 +236,13 @@ class GroundedGenerationServiceClient {
|
|
240
236
|
}
|
241
237
|
// Put together the "service stub" for
|
242
238
|
// google.cloud.discoveryengine.v1.GroundedGenerationService.
|
243
|
-
this.groundedGenerationServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
.GroundedGenerationService, this._opts, this._providedCustomServicePath);
|
239
|
+
this.groundedGenerationServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
240
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1.GroundedGenerationService') :
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
242
|
+
this._protos.google.cloud.discoveryengine.v1.GroundedGenerationService, this._opts, this._providedCustomServicePath);
|
248
243
|
// Iterate over each of the methods that the service provides
|
249
244
|
// and create an API call method for each.
|
250
|
-
const groundedGenerationServiceStubMethods = [
|
251
|
-
'streamGenerateGroundedContent',
|
252
|
-
'generateGroundedContent',
|
253
|
-
'checkGrounding',
|
254
|
-
];
|
245
|
+
const groundedGenerationServiceStubMethods = ['streamGenerateGroundedContent', 'generateGroundedContent', 'checkGrounding'];
|
255
246
|
for (const methodName of groundedGenerationServiceStubMethods) {
|
256
247
|
const callPromise = this.groundedGenerationServiceStub.then(stub => (...args) => {
|
257
248
|
if (this._terminated) {
|
@@ -269,7 +260,8 @@ class GroundedGenerationServiceClient {
|
|
269
260
|
}, (err) => () => {
|
270
261
|
throw err;
|
271
262
|
});
|
272
|
-
const descriptor = this.descriptors.stream[methodName] ||
|
263
|
+
const descriptor = this.descriptors.stream[methodName] ||
|
264
|
+
undefined;
|
273
265
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
274
266
|
this.innerApiCalls[methodName] = apiCall;
|
275
267
|
}
|
@@ -281,8 +273,7 @@ class GroundedGenerationServiceClient {
|
|
281
273
|
* @returns {string} The DNS address for this service.
|
282
274
|
*/
|
283
275
|
static get servicePath() {
|
284
|
-
if (typeof process === 'object' &&
|
285
|
-
typeof process.emitWarning === 'function') {
|
276
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
286
277
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
287
278
|
}
|
288
279
|
return 'discoveryengine.googleapis.com';
|
@@ -293,8 +284,7 @@ class GroundedGenerationServiceClient {
|
|
293
284
|
* @returns {string} The DNS address for this service.
|
294
285
|
*/
|
295
286
|
static get apiEndpoint() {
|
296
|
-
if (typeof process === 'object' &&
|
297
|
-
typeof process.emitWarning === 'function') {
|
287
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
298
288
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
299
289
|
}
|
300
290
|
return 'discoveryengine.googleapis.com';
|
@@ -322,7 +312,9 @@ class GroundedGenerationServiceClient {
|
|
322
312
|
* @returns {string[]} List of default scopes.
|
323
313
|
*/
|
324
314
|
static get scopes() {
|
325
|
-
return [
|
315
|
+
return [
|
316
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
317
|
+
];
|
326
318
|
}
|
327
319
|
/**
|
328
320
|
* Return the project ID used by this class.
|
@@ -348,13 +340,10 @@ class GroundedGenerationServiceClient {
|
|
348
340
|
options = options || {};
|
349
341
|
options.otherArgs = options.otherArgs || {};
|
350
342
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
351
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
352
|
-
|
353
|
-
location: request.location ?? '',
|
354
|
-
});
|
355
|
-
this.initialize().catch(err => {
|
356
|
-
throw err;
|
343
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
344
|
+
'location': request.location ?? '',
|
357
345
|
});
|
346
|
+
this.initialize().catch(err => { throw err; });
|
358
347
|
this._log.info('generateGroundedContent request %j', request);
|
359
348
|
const wrappedCallback = callback
|
360
349
|
? (error, response, options, rawResponse) => {
|
@@ -362,11 +351,16 @@ class GroundedGenerationServiceClient {
|
|
362
351
|
callback(error, response, options, rawResponse); // We verified callback above.
|
363
352
|
}
|
364
353
|
: undefined;
|
365
|
-
return this.innerApiCalls
|
366
|
-
.generateGroundedContent(request, options, wrappedCallback)
|
354
|
+
return this.innerApiCalls.generateGroundedContent(request, options, wrappedCallback)
|
367
355
|
?.then(([response, options, rawResponse]) => {
|
368
356
|
this._log.info('generateGroundedContent response %j', response);
|
369
357
|
return [response, options, rawResponse];
|
358
|
+
}).catch((error) => {
|
359
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
360
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
361
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
362
|
+
}
|
363
|
+
throw error;
|
370
364
|
});
|
371
365
|
}
|
372
366
|
checkGrounding(request, optionsOrCallback, callback) {
|
@@ -382,13 +376,10 @@ class GroundedGenerationServiceClient {
|
|
382
376
|
options = options || {};
|
383
377
|
options.otherArgs = options.otherArgs || {};
|
384
378
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
385
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
386
|
-
|
387
|
-
grounding_config: request.groundingConfig ?? '',
|
388
|
-
});
|
389
|
-
this.initialize().catch(err => {
|
390
|
-
throw err;
|
379
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
380
|
+
'grounding_config': request.groundingConfig ?? '',
|
391
381
|
});
|
382
|
+
this.initialize().catch(err => { throw err; });
|
392
383
|
this._log.info('checkGrounding request %j', request);
|
393
384
|
const wrappedCallback = callback
|
394
385
|
? (error, response, options, rawResponse) => {
|
@@ -396,11 +387,16 @@ class GroundedGenerationServiceClient {
|
|
396
387
|
callback(error, response, options, rawResponse); // We verified callback above.
|
397
388
|
}
|
398
389
|
: undefined;
|
399
|
-
return this.innerApiCalls
|
400
|
-
.checkGrounding(request, options, wrappedCallback)
|
390
|
+
return this.innerApiCalls.checkGrounding(request, options, wrappedCallback)
|
401
391
|
?.then(([response, options, rawResponse]) => {
|
402
392
|
this._log.info('checkGrounding response %j', response);
|
403
393
|
return [response, options, rawResponse];
|
394
|
+
}).catch((error) => {
|
395
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
396
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
397
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
398
|
+
}
|
399
|
+
throw error;
|
404
400
|
});
|
405
401
|
}
|
406
402
|
/**
|
@@ -418,64 +414,62 @@ class GroundedGenerationServiceClient {
|
|
418
414
|
* region_tag:discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_async
|
419
415
|
*/
|
420
416
|
streamGenerateGroundedContent(options) {
|
421
|
-
this.initialize().catch(err => {
|
422
|
-
throw err;
|
423
|
-
});
|
417
|
+
this.initialize().catch(err => { throw err; });
|
424
418
|
this._log.info('streamGenerateGroundedContent stream %j', options);
|
425
419
|
return this.innerApiCalls.streamGenerateGroundedContent(null, options);
|
426
420
|
}
|
427
421
|
/**
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
422
|
+
* Gets information about a location.
|
423
|
+
*
|
424
|
+
* @param {Object} request
|
425
|
+
* The request object that will be sent.
|
426
|
+
* @param {string} request.name
|
427
|
+
* Resource name for the location.
|
428
|
+
* @param {object} [options]
|
429
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
430
|
+
* @returns {Promise} - The promise which resolves to an array.
|
431
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
432
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
433
|
+
* for more details and examples.
|
434
|
+
* @example
|
435
|
+
* ```
|
436
|
+
* const [response] = await client.getLocation(request);
|
437
|
+
* ```
|
438
|
+
*/
|
445
439
|
getLocation(request, options, callback) {
|
446
440
|
return this.locationsClient.getLocation(request, options, callback);
|
447
441
|
}
|
448
442
|
/**
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
443
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
444
|
+
*
|
445
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
446
|
+
* @param {Object} request
|
447
|
+
* The request object that will be sent.
|
448
|
+
* @param {string} request.name
|
449
|
+
* The resource that owns the locations collection, if applicable.
|
450
|
+
* @param {string} request.filter
|
451
|
+
* The standard list filter.
|
452
|
+
* @param {number} request.pageSize
|
453
|
+
* The standard list page size.
|
454
|
+
* @param {string} request.pageToken
|
455
|
+
* The standard list page token.
|
456
|
+
* @param {object} [options]
|
457
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
458
|
+
* @returns {Object}
|
459
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
460
|
+
* When you iterate the returned iterable, each element will be an object representing
|
461
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
462
|
+
* so you can stop the iteration when you don't need more results.
|
463
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
464
|
+
* for more details and examples.
|
465
|
+
* @example
|
466
|
+
* ```
|
467
|
+
* const iterable = client.listLocationsAsync(request);
|
468
|
+
* for await (const response of iterable) {
|
469
|
+
* // process response
|
470
|
+
* }
|
471
|
+
* ```
|
472
|
+
*/
|
479
473
|
listLocationsAsync(request, options) {
|
480
474
|
return this.locationsClient.listLocationsAsync(request, options);
|
481
475
|
}
|
@@ -584,6 +578,51 @@ class GroundedGenerationServiceClient {
|
|
584
578
|
matchGroundingConfigFromGroundingConfigName(groundingConfigName) {
|
585
579
|
return this.pathTemplates.groundingConfigPathTemplate.match(groundingConfigName).grounding_config;
|
586
580
|
}
|
581
|
+
/**
|
582
|
+
* Return a fully-qualified identityMappingStore resource name string.
|
583
|
+
*
|
584
|
+
* @param {string} project
|
585
|
+
* @param {string} location
|
586
|
+
* @param {string} identity_mapping_store
|
587
|
+
* @returns {string} Resource name string.
|
588
|
+
*/
|
589
|
+
identityMappingStorePath(project, location, identityMappingStore) {
|
590
|
+
return this.pathTemplates.identityMappingStorePathTemplate.render({
|
591
|
+
project: project,
|
592
|
+
location: location,
|
593
|
+
identity_mapping_store: identityMappingStore,
|
594
|
+
});
|
595
|
+
}
|
596
|
+
/**
|
597
|
+
* Parse the project from IdentityMappingStore resource.
|
598
|
+
*
|
599
|
+
* @param {string} identityMappingStoreName
|
600
|
+
* A fully-qualified path representing IdentityMappingStore resource.
|
601
|
+
* @returns {string} A string representing the project.
|
602
|
+
*/
|
603
|
+
matchProjectFromIdentityMappingStoreName(identityMappingStoreName) {
|
604
|
+
return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).project;
|
605
|
+
}
|
606
|
+
/**
|
607
|
+
* Parse the location from IdentityMappingStore resource.
|
608
|
+
*
|
609
|
+
* @param {string} identityMappingStoreName
|
610
|
+
* A fully-qualified path representing IdentityMappingStore resource.
|
611
|
+
* @returns {string} A string representing the location.
|
612
|
+
*/
|
613
|
+
matchLocationFromIdentityMappingStoreName(identityMappingStoreName) {
|
614
|
+
return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).location;
|
615
|
+
}
|
616
|
+
/**
|
617
|
+
* Parse the identity_mapping_store from IdentityMappingStore resource.
|
618
|
+
*
|
619
|
+
* @param {string} identityMappingStoreName
|
620
|
+
* A fully-qualified path representing IdentityMappingStore resource.
|
621
|
+
* @returns {string} A string representing the identity_mapping_store.
|
622
|
+
*/
|
623
|
+
matchIdentityMappingStoreFromIdentityMappingStoreName(identityMappingStoreName) {
|
624
|
+
return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).identity_mapping_store;
|
625
|
+
}
|
587
626
|
/**
|
588
627
|
* Return a fully-qualified location resource name string.
|
589
628
|
*
|
@@ -638,6 +677,84 @@ class GroundedGenerationServiceClient {
|
|
638
677
|
matchProjectFromProjectName(projectName) {
|
639
678
|
return this.pathTemplates.projectPathTemplate.match(projectName).project;
|
640
679
|
}
|
680
|
+
/**
|
681
|
+
* Return a fully-qualified projectLocationCmekConfig resource name string.
|
682
|
+
*
|
683
|
+
* @param {string} project
|
684
|
+
* @param {string} location
|
685
|
+
* @returns {string} Resource name string.
|
686
|
+
*/
|
687
|
+
projectLocationCmekConfigPath(project, location) {
|
688
|
+
return this.pathTemplates.projectLocationCmekConfigPathTemplate.render({
|
689
|
+
project: project,
|
690
|
+
location: location,
|
691
|
+
});
|
692
|
+
}
|
693
|
+
/**
|
694
|
+
* Parse the project from ProjectLocationCmekConfig resource.
|
695
|
+
*
|
696
|
+
* @param {string} projectLocationCmekConfigName
|
697
|
+
* A fully-qualified path representing project_location_cmekConfig resource.
|
698
|
+
* @returns {string} A string representing the project.
|
699
|
+
*/
|
700
|
+
matchProjectFromProjectLocationCmekConfigName(projectLocationCmekConfigName) {
|
701
|
+
return this.pathTemplates.projectLocationCmekConfigPathTemplate.match(projectLocationCmekConfigName).project;
|
702
|
+
}
|
703
|
+
/**
|
704
|
+
* Parse the location from ProjectLocationCmekConfig resource.
|
705
|
+
*
|
706
|
+
* @param {string} projectLocationCmekConfigName
|
707
|
+
* A fully-qualified path representing project_location_cmekConfig resource.
|
708
|
+
* @returns {string} A string representing the location.
|
709
|
+
*/
|
710
|
+
matchLocationFromProjectLocationCmekConfigName(projectLocationCmekConfigName) {
|
711
|
+
return this.pathTemplates.projectLocationCmekConfigPathTemplate.match(projectLocationCmekConfigName).location;
|
712
|
+
}
|
713
|
+
/**
|
714
|
+
* Return a fully-qualified projectLocationCmekConfigs resource name string.
|
715
|
+
*
|
716
|
+
* @param {string} project
|
717
|
+
* @param {string} location
|
718
|
+
* @param {string} cmek_config
|
719
|
+
* @returns {string} Resource name string.
|
720
|
+
*/
|
721
|
+
projectLocationCmekConfigsPath(project, location, cmekConfig) {
|
722
|
+
return this.pathTemplates.projectLocationCmekConfigsPathTemplate.render({
|
723
|
+
project: project,
|
724
|
+
location: location,
|
725
|
+
cmek_config: cmekConfig,
|
726
|
+
});
|
727
|
+
}
|
728
|
+
/**
|
729
|
+
* Parse the project from ProjectLocationCmekConfigs resource.
|
730
|
+
*
|
731
|
+
* @param {string} projectLocationCmekConfigsName
|
732
|
+
* A fully-qualified path representing project_location_cmekConfigs resource.
|
733
|
+
* @returns {string} A string representing the project.
|
734
|
+
*/
|
735
|
+
matchProjectFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
|
736
|
+
return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).project;
|
737
|
+
}
|
738
|
+
/**
|
739
|
+
* Parse the location from ProjectLocationCmekConfigs resource.
|
740
|
+
*
|
741
|
+
* @param {string} projectLocationCmekConfigsName
|
742
|
+
* A fully-qualified path representing project_location_cmekConfigs resource.
|
743
|
+
* @returns {string} A string representing the location.
|
744
|
+
*/
|
745
|
+
matchLocationFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
|
746
|
+
return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).location;
|
747
|
+
}
|
748
|
+
/**
|
749
|
+
* Parse the cmek_config from ProjectLocationCmekConfigs resource.
|
750
|
+
*
|
751
|
+
* @param {string} projectLocationCmekConfigsName
|
752
|
+
* A fully-qualified path representing project_location_cmekConfigs resource.
|
753
|
+
* @returns {string} A string representing the cmek_config.
|
754
|
+
*/
|
755
|
+
matchCmekConfigFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
|
756
|
+
return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).cmek_config;
|
757
|
+
}
|
641
758
|
/**
|
642
759
|
* Return a fully-qualified projectLocationCollectionDataStore resource name string.
|
643
760
|
*
|
@@ -2795,7 +2912,7 @@ class GroundedGenerationServiceClient {
|
|
2795
2912
|
this._log.info('ending gRPC channel');
|
2796
2913
|
this._terminated = true;
|
2797
2914
|
stub.close();
|
2798
|
-
this.locationsClient.close();
|
2915
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2799
2916
|
});
|
2800
2917
|
}
|
2801
2918
|
return Promise.resolve();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
[
|
2
2
|
"../../protos/google/cloud/discoveryengine/v1/answer.proto",
|
3
3
|
"../../protos/google/cloud/discoveryengine/v1/chunk.proto",
|
4
|
+
"../../protos/google/cloud/discoveryengine/v1/cmek_config_service.proto",
|
4
5
|
"../../protos/google/cloud/discoveryengine/v1/common.proto",
|
5
6
|
"../../protos/google/cloud/discoveryengine/v1/completion.proto",
|
6
7
|
"../../protos/google/cloud/discoveryengine/v1/completion_service.proto",
|
@@ -18,6 +19,8 @@
|
|
18
19
|
"../../protos/google/cloud/discoveryengine/v1/engine_service.proto",
|
19
20
|
"../../protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto",
|
20
21
|
"../../protos/google/cloud/discoveryengine/v1/grounding.proto",
|
22
|
+
"../../protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto",
|
23
|
+
"../../protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto",
|
21
24
|
"../../protos/google/cloud/discoveryengine/v1/import_config.proto",
|
22
25
|
"../../protos/google/cloud/discoveryengine/v1/project.proto",
|
23
26
|
"../../protos/google/cloud/discoveryengine/v1/project_service.proto",
|
@@ -35,5 +38,7 @@
|
|
35
38
|
"../../protos/google/cloud/discoveryengine/v1/site_search_engine.proto",
|
36
39
|
"../../protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto",
|
37
40
|
"../../protos/google/cloud/discoveryengine/v1/user_event.proto",
|
38
|
-
"../../protos/google/cloud/discoveryengine/v1/user_event_service.proto"
|
41
|
+
"../../protos/google/cloud/discoveryengine/v1/user_event_service.proto",
|
42
|
+
"../../protos/google/cloud/discoveryengine/v1/user_license.proto",
|
43
|
+
"../../protos/google/cloud/discoveryengine/v1/user_license_service.proto"
|
39
44
|
]
|