@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
@@ -168,7 +168,7 @@ export declare class GroundedGenerationServiceClient {
|
|
168
168
|
*/
|
169
169
|
generateGroundedContent(request?: protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentRequest, options?: CallOptions): Promise<[
|
170
170
|
protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentResponse,
|
171
|
-
|
171
|
+
protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentRequest | undefined,
|
172
172
|
{} | undefined
|
173
173
|
]>;
|
174
174
|
generateGroundedContent(request: protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentResponse, protos.google.cloud.discoveryengine.v1beta.IGenerateGroundedContentRequest | null | undefined, {} | null | undefined>): void;
|
@@ -217,7 +217,7 @@ export declare class GroundedGenerationServiceClient {
|
|
217
217
|
*/
|
218
218
|
checkGrounding(request?: protos.google.cloud.discoveryengine.v1beta.ICheckGroundingRequest, options?: CallOptions): Promise<[
|
219
219
|
protos.google.cloud.discoveryengine.v1beta.ICheckGroundingResponse,
|
220
|
-
|
220
|
+
protos.google.cloud.discoveryengine.v1beta.ICheckGroundingRequest | undefined,
|
221
221
|
{} | undefined
|
222
222
|
]>;
|
223
223
|
checkGrounding(request: protos.google.cloud.discoveryengine.v1beta.ICheckGroundingRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.ICheckGroundingResponse, protos.google.cloud.discoveryengine.v1beta.ICheckGroundingRequest | null | undefined, {} | null | undefined>): void;
|
@@ -238,55 +238,55 @@ export declare class GroundedGenerationServiceClient {
|
|
238
238
|
*/
|
239
239
|
streamGenerateGroundedContent(options?: CallOptions): gax.CancellableStream;
|
240
240
|
/**
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
241
|
+
* Gets information about a location.
|
242
|
+
*
|
243
|
+
* @param {Object} request
|
244
|
+
* The request object that will be sent.
|
245
|
+
* @param {string} request.name
|
246
|
+
* Resource name for the location.
|
247
|
+
* @param {object} [options]
|
248
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
249
|
+
* @returns {Promise} - The promise which resolves to an array.
|
250
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
251
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
252
|
+
* for more details and examples.
|
253
|
+
* @example
|
254
|
+
* ```
|
255
|
+
* const [response] = await client.getLocation(request);
|
256
|
+
* ```
|
257
|
+
*/
|
258
258
|
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
|
259
259
|
/**
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
260
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
261
|
+
*
|
262
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
263
|
+
* @param {Object} request
|
264
|
+
* The request object that will be sent.
|
265
|
+
* @param {string} request.name
|
266
|
+
* The resource that owns the locations collection, if applicable.
|
267
|
+
* @param {string} request.filter
|
268
|
+
* The standard list filter.
|
269
|
+
* @param {number} request.pageSize
|
270
|
+
* The standard list page size.
|
271
|
+
* @param {string} request.pageToken
|
272
|
+
* The standard list page token.
|
273
|
+
* @param {object} [options]
|
274
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
275
|
+
* @returns {Object}
|
276
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
277
|
+
* When you iterate the returned iterable, each element will be an object representing
|
278
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
279
|
+
* so you can stop the iteration when you don't need more results.
|
280
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
281
|
+
* for more details and examples.
|
282
|
+
* @example
|
283
|
+
* ```
|
284
|
+
* const iterable = client.listLocationsAsync(request);
|
285
|
+
* for await (const response of iterable) {
|
286
|
+
* // process response
|
287
|
+
* }
|
288
|
+
* ```
|
289
|
+
*/
|
290
290
|
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
291
291
|
/**
|
292
292
|
* Return a fully-qualified engine resource name string.
|
@@ -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
|
}
|
@@ -214,7 +207,7 @@ class GroundedGenerationServiceClient {
|
|
214
207
|
// Some of the methods on this service provide streaming responses.
|
215
208
|
// Provide descriptors for these.
|
216
209
|
this.descriptors.stream = {
|
217
|
-
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)
|
218
211
|
};
|
219
212
|
// Put together the default options sent with requests.
|
220
213
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.GroundedGenerationService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -243,18 +236,13 @@ class GroundedGenerationServiceClient {
|
|
243
236
|
}
|
244
237
|
// Put together the "service stub" for
|
245
238
|
// google.cloud.discoveryengine.v1beta.GroundedGenerationService.
|
246
|
-
this.groundedGenerationServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
.GroundedGenerationService, this._opts, this._providedCustomServicePath);
|
239
|
+
this.groundedGenerationServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
240
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1beta.GroundedGenerationService') :
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
242
|
+
this._protos.google.cloud.discoveryengine.v1beta.GroundedGenerationService, this._opts, this._providedCustomServicePath);
|
251
243
|
// Iterate over each of the methods that the service provides
|
252
244
|
// and create an API call method for each.
|
253
|
-
const groundedGenerationServiceStubMethods = [
|
254
|
-
'streamGenerateGroundedContent',
|
255
|
-
'generateGroundedContent',
|
256
|
-
'checkGrounding',
|
257
|
-
];
|
245
|
+
const groundedGenerationServiceStubMethods = ['streamGenerateGroundedContent', 'generateGroundedContent', 'checkGrounding'];
|
258
246
|
for (const methodName of groundedGenerationServiceStubMethods) {
|
259
247
|
const callPromise = this.groundedGenerationServiceStub.then(stub => (...args) => {
|
260
248
|
if (this._terminated) {
|
@@ -272,7 +260,8 @@ class GroundedGenerationServiceClient {
|
|
272
260
|
}, (err) => () => {
|
273
261
|
throw err;
|
274
262
|
});
|
275
|
-
const descriptor = this.descriptors.stream[methodName] ||
|
263
|
+
const descriptor = this.descriptors.stream[methodName] ||
|
264
|
+
undefined;
|
276
265
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
277
266
|
this.innerApiCalls[methodName] = apiCall;
|
278
267
|
}
|
@@ -284,8 +273,7 @@ class GroundedGenerationServiceClient {
|
|
284
273
|
* @returns {string} The DNS address for this service.
|
285
274
|
*/
|
286
275
|
static get servicePath() {
|
287
|
-
if (typeof process === 'object' &&
|
288
|
-
typeof process.emitWarning === 'function') {
|
276
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
289
277
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
290
278
|
}
|
291
279
|
return 'discoveryengine.googleapis.com';
|
@@ -296,8 +284,7 @@ class GroundedGenerationServiceClient {
|
|
296
284
|
* @returns {string} The DNS address for this service.
|
297
285
|
*/
|
298
286
|
static get apiEndpoint() {
|
299
|
-
if (typeof process === 'object' &&
|
300
|
-
typeof process.emitWarning === 'function') {
|
287
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
301
288
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
302
289
|
}
|
303
290
|
return 'discoveryengine.googleapis.com';
|
@@ -325,7 +312,9 @@ class GroundedGenerationServiceClient {
|
|
325
312
|
* @returns {string[]} List of default scopes.
|
326
313
|
*/
|
327
314
|
static get scopes() {
|
328
|
-
return [
|
315
|
+
return [
|
316
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
317
|
+
];
|
329
318
|
}
|
330
319
|
/**
|
331
320
|
* Return the project ID used by this class.
|
@@ -351,13 +340,10 @@ class GroundedGenerationServiceClient {
|
|
351
340
|
options = options || {};
|
352
341
|
options.otherArgs = options.otherArgs || {};
|
353
342
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
354
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
355
|
-
|
356
|
-
location: request.location ?? '',
|
357
|
-
});
|
358
|
-
this.initialize().catch(err => {
|
359
|
-
throw err;
|
343
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
344
|
+
'location': request.location ?? '',
|
360
345
|
});
|
346
|
+
this.initialize().catch(err => { throw err; });
|
361
347
|
this._log.info('generateGroundedContent request %j', request);
|
362
348
|
const wrappedCallback = callback
|
363
349
|
? (error, response, options, rawResponse) => {
|
@@ -365,11 +351,16 @@ class GroundedGenerationServiceClient {
|
|
365
351
|
callback(error, response, options, rawResponse); // We verified callback above.
|
366
352
|
}
|
367
353
|
: undefined;
|
368
|
-
return this.innerApiCalls
|
369
|
-
.generateGroundedContent(request, options, wrappedCallback)
|
354
|
+
return this.innerApiCalls.generateGroundedContent(request, options, wrappedCallback)
|
370
355
|
?.then(([response, options, rawResponse]) => {
|
371
356
|
this._log.info('generateGroundedContent response %j', response);
|
372
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;
|
373
364
|
});
|
374
365
|
}
|
375
366
|
checkGrounding(request, optionsOrCallback, callback) {
|
@@ -385,13 +376,10 @@ class GroundedGenerationServiceClient {
|
|
385
376
|
options = options || {};
|
386
377
|
options.otherArgs = options.otherArgs || {};
|
387
378
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
388
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
389
|
-
|
390
|
-
grounding_config: request.groundingConfig ?? '',
|
391
|
-
});
|
392
|
-
this.initialize().catch(err => {
|
393
|
-
throw err;
|
379
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
380
|
+
'grounding_config': request.groundingConfig ?? '',
|
394
381
|
});
|
382
|
+
this.initialize().catch(err => { throw err; });
|
395
383
|
this._log.info('checkGrounding request %j', request);
|
396
384
|
const wrappedCallback = callback
|
397
385
|
? (error, response, options, rawResponse) => {
|
@@ -399,11 +387,16 @@ class GroundedGenerationServiceClient {
|
|
399
387
|
callback(error, response, options, rawResponse); // We verified callback above.
|
400
388
|
}
|
401
389
|
: undefined;
|
402
|
-
return this.innerApiCalls
|
403
|
-
.checkGrounding(request, options, wrappedCallback)
|
390
|
+
return this.innerApiCalls.checkGrounding(request, options, wrappedCallback)
|
404
391
|
?.then(([response, options, rawResponse]) => {
|
405
392
|
this._log.info('checkGrounding response %j', response);
|
406
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;
|
407
400
|
});
|
408
401
|
}
|
409
402
|
/**
|
@@ -421,64 +414,62 @@ class GroundedGenerationServiceClient {
|
|
421
414
|
* region_tag:discoveryengine_v1beta_generated_GroundedGenerationService_StreamGenerateGroundedContent_async
|
422
415
|
*/
|
423
416
|
streamGenerateGroundedContent(options) {
|
424
|
-
this.initialize().catch(err => {
|
425
|
-
throw err;
|
426
|
-
});
|
417
|
+
this.initialize().catch(err => { throw err; });
|
427
418
|
this._log.info('streamGenerateGroundedContent stream %j', options);
|
428
419
|
return this.innerApiCalls.streamGenerateGroundedContent(null, options);
|
429
420
|
}
|
430
421
|
/**
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
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
|
+
*/
|
448
439
|
getLocation(request, options, callback) {
|
449
440
|
return this.locationsClient.getLocation(request, options, callback);
|
450
441
|
}
|
451
442
|
/**
|
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
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
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
|
+
*/
|
482
473
|
listLocationsAsync(request, options) {
|
483
474
|
return this.locationsClient.listLocationsAsync(request, options);
|
484
475
|
}
|
@@ -565,8 +556,7 @@ class GroundedGenerationServiceClient {
|
|
565
556
|
* @returns {string} A string representing the project.
|
566
557
|
*/
|
567
558
|
matchProjectFromEvaluationName(evaluationName) {
|
568
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
569
|
-
.project;
|
559
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
570
560
|
}
|
571
561
|
/**
|
572
562
|
* Parse the location from Evaluation resource.
|
@@ -576,8 +566,7 @@ class GroundedGenerationServiceClient {
|
|
576
566
|
* @returns {string} A string representing the location.
|
577
567
|
*/
|
578
568
|
matchLocationFromEvaluationName(evaluationName) {
|
579
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
580
|
-
.location;
|
569
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
581
570
|
}
|
582
571
|
/**
|
583
572
|
* Parse the evaluation from Evaluation resource.
|
@@ -587,8 +576,7 @@ class GroundedGenerationServiceClient {
|
|
587
576
|
* @returns {string} A string representing the evaluation.
|
588
577
|
*/
|
589
578
|
matchEvaluationFromEvaluationName(evaluationName) {
|
590
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
591
|
-
.evaluation;
|
579
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
592
580
|
}
|
593
581
|
/**
|
594
582
|
* Return a fully-qualified groundingConfig resource name string.
|
@@ -2859,8 +2847,7 @@ class GroundedGenerationServiceClient {
|
|
2859
2847
|
* @returns {string} A string representing the project.
|
2860
2848
|
*/
|
2861
2849
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
2862
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2863
|
-
.project;
|
2850
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
2864
2851
|
}
|
2865
2852
|
/**
|
2866
2853
|
* Parse the location from SampleQuery resource.
|
@@ -2870,8 +2857,7 @@ class GroundedGenerationServiceClient {
|
|
2870
2857
|
* @returns {string} A string representing the location.
|
2871
2858
|
*/
|
2872
2859
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
2873
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2874
|
-
.location;
|
2860
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
2875
2861
|
}
|
2876
2862
|
/**
|
2877
2863
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -2881,8 +2867,7 @@ class GroundedGenerationServiceClient {
|
|
2881
2867
|
* @returns {string} A string representing the sample_query_set.
|
2882
2868
|
*/
|
2883
2869
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
2884
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2885
|
-
.sample_query_set;
|
2870
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
2886
2871
|
}
|
2887
2872
|
/**
|
2888
2873
|
* Parse the sample_query from SampleQuery resource.
|
@@ -2892,8 +2877,7 @@ class GroundedGenerationServiceClient {
|
|
2892
2877
|
* @returns {string} A string representing the sample_query.
|
2893
2878
|
*/
|
2894
2879
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
2895
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2896
|
-
.sample_query;
|
2880
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
2897
2881
|
}
|
2898
2882
|
/**
|
2899
2883
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -2952,7 +2936,7 @@ class GroundedGenerationServiceClient {
|
|
2952
2936
|
this._log.info('ending gRPC channel');
|
2953
2937
|
this._terminated = true;
|
2954
2938
|
stub.close();
|
2955
|
-
this.locationsClient.close();
|
2939
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2956
2940
|
});
|
2957
2941
|
}
|
2958
2942
|
return Promise.resolve();
|