@google-cloud/discoveryengine 0.8.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +30 -0
- package/README.md +13 -1
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
- package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
- package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
- package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +7 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +13 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +138 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +306 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +2 -4
- package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +2 -1
- package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +17 -17
- package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +276 -64
- package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +45 -36
- package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +2 -2
- package/build/protos/protos.d.ts +13913 -8367
- package/build/protos/protos.js +36766 -22883
- package/build/protos/protos.json +3956 -2571
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -1
- package/build/src/v1/completion_service_client.d.ts +161 -12
- package/build/src/v1/completion_service_client.js +188 -4
- package/build/src/v1/conversational_search_service_client.d.ts +947 -0
- package/build/src/v1/conversational_search_service_client.js +1205 -0
- package/build/src/v1/conversational_search_service_client_config.json +68 -0
- package/build/src/v1/document_service_client.d.ts +245 -109
- package/build/src/v1/document_service_client.js +231 -31
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +3 -1
- package/build/src/v1/schema_service_client.d.ts +187 -53
- package/build/src/v1/schema_service_client.js +224 -27
- package/build/src/v1/search_service_client.d.ts +266 -59
- package/build/src/v1/search_service_client.js +267 -41
- package/build/src/v1/user_event_service_client.d.ts +159 -19
- package/build/src/v1/user_event_service_client.js +208 -7
- package/build/src/v1beta/completion_service_client.d.ts +159 -12
- package/build/src/v1beta/completion_service_client.js +188 -4
- package/build/src/v1beta/conversational_search_service_client.d.ts +947 -0
- package/build/src/v1beta/conversational_search_service_client.js +1205 -0
- package/build/src/v1beta/conversational_search_service_client_config.json +68 -0
- package/build/src/v1beta/document_service_client.d.ts +237 -101
- package/build/src/v1beta/document_service_client.js +227 -27
- package/build/src/v1beta/index.d.ts +1 -0
- package/build/src/v1beta/index.js +3 -1
- package/build/src/v1beta/recommendation_service_client.d.ts +158 -15
- package/build/src/v1beta/recommendation_service_client.js +188 -4
- package/build/src/v1beta/schema_service_client.d.ts +187 -53
- package/build/src/v1beta/schema_service_client.js +224 -27
- package/build/src/v1beta/search_service_client.d.ts +305 -71
- package/build/src/v1beta/search_service_client.js +293 -49
- package/build/src/v1beta/user_event_service_client.d.ts +156 -16
- package/build/src/v1beta/user_event_service_client.js +208 -7
- package/package.json +10 -13
@@ -60,8 +60,7 @@ class SearchServiceClient {
|
|
60
60
|
* API remote host.
|
61
61
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
62
62
|
* Follows the structure of {@link gapicConfig}.
|
63
|
-
* @param {boolean
|
64
|
-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
63
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
65
64
|
* For more information, please check the
|
66
65
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
67
66
|
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
@@ -69,7 +68,7 @@ class SearchServiceClient {
|
|
69
68
|
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
70
69
|
* ```
|
71
70
|
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
72
|
-
* const client = new SearchServiceClient({fallback:
|
71
|
+
* const client = new SearchServiceClient({fallback: true}, gax);
|
73
72
|
* ```
|
74
73
|
*/
|
75
74
|
constructor(opts, gaxInstance) {
|
@@ -115,6 +114,7 @@ class SearchServiceClient {
|
|
115
114
|
if (servicePath === staticMembers.servicePath) {
|
116
115
|
this.auth.defaultScopes = staticMembers.scopes;
|
117
116
|
}
|
117
|
+
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
118
118
|
// Determine the client header string.
|
119
119
|
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
|
120
120
|
if (typeof process !== 'undefined' && 'versions' in process) {
|
@@ -126,7 +126,7 @@ class SearchServiceClient {
|
|
126
126
|
if (!opts.fallback) {
|
127
127
|
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
|
128
128
|
}
|
129
|
-
else
|
129
|
+
else {
|
130
130
|
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
|
131
131
|
}
|
132
132
|
if (opts.libName && opts.libVersion) {
|
@@ -140,10 +140,12 @@ class SearchServiceClient {
|
|
140
140
|
this.pathTemplates = {
|
141
141
|
projectLocationCollectionDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}'),
|
142
142
|
projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
|
143
|
+
projectLocationCollectionDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}'),
|
143
144
|
projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
|
144
145
|
projectLocationCollectionDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}'),
|
145
146
|
projectLocationDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}'),
|
146
147
|
projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
|
148
|
+
projectLocationDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}'),
|
147
149
|
projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
|
148
150
|
projectLocationDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}'),
|
149
151
|
};
|
@@ -283,27 +285,29 @@ class SearchServiceClient {
|
|
283
285
|
* documents under the default branch.
|
284
286
|
* @param {string} request.query
|
285
287
|
* Raw search query.
|
288
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ImageQuery} request.imageQuery
|
289
|
+
* Raw image query.
|
286
290
|
* @param {number} request.pageSize
|
287
|
-
* Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
|
291
|
+
* Maximum number of {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}s
|
288
292
|
* to return. If unspecified, defaults to a reasonable value. The maximum
|
289
|
-
* allowed value is 100. Values above 100
|
293
|
+
* allowed value is 100. Values above 100 are coerced to 100.
|
290
294
|
*
|
291
295
|
* If this field is negative, an `INVALID_ARGUMENT` is returned.
|
292
296
|
* @param {string} request.pageToken
|
293
297
|
* A page token received from a previous
|
294
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
298
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
295
299
|
* call. Provide this to retrieve the subsequent page.
|
296
300
|
*
|
297
301
|
* When paginating, all other parameters provided to
|
298
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
302
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
299
303
|
* must match the call that provided the page token. Otherwise, an
|
300
304
|
* `INVALID_ARGUMENT` error is returned.
|
301
305
|
* @param {number} request.offset
|
302
306
|
* A 0-indexed integer that specifies the current offset (that is, starting
|
303
307
|
* result location, amongst the
|
304
|
-
* {@link google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
|
308
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
|
305
309
|
* as relevant) in search results. This field is only considered if
|
306
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
|
310
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
|
307
311
|
* is unset.
|
308
312
|
*
|
309
313
|
* If this field is negative, an `INVALID_ARGUMENT` is returned.
|
@@ -314,16 +318,17 @@ class SearchServiceClient {
|
|
314
318
|
*
|
315
319
|
* If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
316
320
|
* @param {string} request.orderBy
|
317
|
-
* The order in which documents are returned.
|
318
|
-
* a field in an {@link google.cloud.discoveryengine.v1beta.Document|Document}
|
319
|
-
* object. Leave it unset if ordered by relevance.
|
321
|
+
* The order in which documents are returned. Documents can be ordered by
|
322
|
+
* a field in an {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}
|
323
|
+
* object. Leave it unset if ordered by relevance. `order_by` expression is
|
320
324
|
* case-sensitive.
|
321
325
|
*
|
322
|
-
* If this field is unrecognizable, an
|
326
|
+
* If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
323
327
|
* @param {google.cloud.discoveryengine.v1beta.UserInfo} request.userInfo
|
324
328
|
* Information about the end user.
|
325
|
-
* Highly recommended for analytics.
|
326
|
-
*
|
329
|
+
* Highly recommended for analytics.
|
330
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.UserInfo.user_agent|UserInfo.user_agent}
|
331
|
+
* is used to deduce `device_type` for analytics.
|
327
332
|
* @param {number[]} request.facetSpecs
|
328
333
|
* Facet specifications for faceted search. If empty, no facets are returned.
|
329
334
|
*
|
@@ -343,10 +348,10 @@ class SearchServiceClient {
|
|
343
348
|
* which enables image searching.
|
344
349
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
|
345
350
|
* The query expansion specification that specifies the conditions under which
|
346
|
-
* query expansion
|
351
|
+
* query expansion occurs.
|
347
352
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
|
348
353
|
* The spell correction specification that specifies the mode under
|
349
|
-
* which spell correction
|
354
|
+
* which spell correction takes effect.
|
350
355
|
* @param {string} request.userPseudoId
|
351
356
|
* A unique identifier for tracking visitors. For example, this could be
|
352
357
|
* implemented with an HTTP cookie, which should be able to uniquely identify
|
@@ -356,18 +361,46 @@ class SearchServiceClient {
|
|
356
361
|
* This field should NOT have a fixed value such as `unknown_visitor`.
|
357
362
|
*
|
358
363
|
* This should be the same identifier as
|
359
|
-
* {@link google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
|
364
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
|
360
365
|
* and
|
361
|
-
* {@link google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
|
366
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
|
362
367
|
*
|
363
368
|
* The field must be a UTF-8 encoded string with a length limit of 128
|
364
369
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
365
370
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
366
|
-
*
|
367
|
-
*
|
371
|
+
* A specification for configuring the behavior of content search.
|
372
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} request.embeddingSpec
|
373
|
+
* Uses the provided embedding to do additional semantic document retrieval.
|
374
|
+
* The retrieval is based on the dot product of
|
375
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.vector} and the document
|
376
|
+
* embedding that is provided in
|
377
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path}.
|
378
|
+
*
|
379
|
+
* If {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path} is not
|
380
|
+
* provided, it will use {@link protos.|ServingConfig.embedding_config.field_paths}.
|
381
|
+
* @param {string} request.rankingExpression
|
382
|
+
* The ranking expression controls the customized ranking on retrieval
|
383
|
+
* documents. This overrides {@link protos.|ServingConfig.ranking_expression}.
|
384
|
+
* The ranking expression is a single function or multiple functions that are
|
385
|
+
* joint by "+".
|
386
|
+
* * ranking_expression = function, { " + ", function };
|
387
|
+
* Supported functions:
|
388
|
+
* * double * relevance_score
|
389
|
+
* * double * dotProduct(embedding_field_path)
|
390
|
+
* Function variables:
|
391
|
+
* `relevance_score`: pre-defined keywords, used for measure relevance
|
392
|
+
* between query and document.
|
393
|
+
* `embedding_field_path`: the document embedding field
|
394
|
+
* used with query embedding vector.
|
395
|
+
* `dotProduct`: embedding function between embedding_field_path and query
|
396
|
+
* embedding vector.
|
397
|
+
*
|
398
|
+
* Example ranking expression:
|
399
|
+
* If document has an embedding field doc_embedding, the ranking expression
|
400
|
+
* could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
368
401
|
* @param {boolean} request.safeSearch
|
369
402
|
* Whether to turn on safe search. This is only supported for
|
370
|
-
*
|
403
|
+
* website search.
|
371
404
|
* @param {number[]} request.userLabels
|
372
405
|
* The user labels applied to a resource must meet the following requirements:
|
373
406
|
*
|
@@ -389,13 +422,12 @@ class SearchServiceClient {
|
|
389
422
|
* @param {object} [options]
|
390
423
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
391
424
|
* @returns {Stream}
|
392
|
-
* An object stream which emits an object representing {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult
|
425
|
+
* An object stream which emits an object representing {@link protos.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult|SearchResult} on 'data' event.
|
393
426
|
* The client library will perform auto-pagination by default: it will call the API as many
|
394
427
|
* times as needed. Note that it can affect your quota.
|
395
428
|
* We recommend using `searchAsync()`
|
396
429
|
* method described below for async iteration which you can stop as needed.
|
397
|
-
* Please see the
|
398
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
430
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
399
431
|
* for more details and examples.
|
400
432
|
*/
|
401
433
|
searchStream(request, options) {
|
@@ -432,27 +464,29 @@ class SearchServiceClient {
|
|
432
464
|
* documents under the default branch.
|
433
465
|
* @param {string} request.query
|
434
466
|
* Raw search query.
|
467
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ImageQuery} request.imageQuery
|
468
|
+
* Raw image query.
|
435
469
|
* @param {number} request.pageSize
|
436
|
-
* Maximum number of {@link google.cloud.discoveryengine.v1beta.Document|Document}s
|
470
|
+
* Maximum number of {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}s
|
437
471
|
* to return. If unspecified, defaults to a reasonable value. The maximum
|
438
|
-
* allowed value is 100. Values above 100
|
472
|
+
* allowed value is 100. Values above 100 are coerced to 100.
|
439
473
|
*
|
440
474
|
* If this field is negative, an `INVALID_ARGUMENT` is returned.
|
441
475
|
* @param {string} request.pageToken
|
442
476
|
* A page token received from a previous
|
443
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
477
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
444
478
|
* call. Provide this to retrieve the subsequent page.
|
445
479
|
*
|
446
480
|
* When paginating, all other parameters provided to
|
447
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
481
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchService.Search|SearchService.Search}
|
448
482
|
* must match the call that provided the page token. Otherwise, an
|
449
483
|
* `INVALID_ARGUMENT` error is returned.
|
450
484
|
* @param {number} request.offset
|
451
485
|
* A 0-indexed integer that specifies the current offset (that is, starting
|
452
486
|
* result location, amongst the
|
453
|
-
* {@link google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
|
487
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}s deemed by the API
|
454
488
|
* as relevant) in search results. This field is only considered if
|
455
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
|
489
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchRequest.page_token|page_token}
|
456
490
|
* is unset.
|
457
491
|
*
|
458
492
|
* If this field is negative, an `INVALID_ARGUMENT` is returned.
|
@@ -463,16 +497,17 @@ class SearchServiceClient {
|
|
463
497
|
*
|
464
498
|
* If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
465
499
|
* @param {string} request.orderBy
|
466
|
-
* The order in which documents are returned.
|
467
|
-
* a field in an {@link google.cloud.discoveryengine.v1beta.Document|Document}
|
468
|
-
* object. Leave it unset if ordered by relevance.
|
500
|
+
* The order in which documents are returned. Documents can be ordered by
|
501
|
+
* a field in an {@link protos.google.cloud.discoveryengine.v1beta.Document|Document}
|
502
|
+
* object. Leave it unset if ordered by relevance. `order_by` expression is
|
469
503
|
* case-sensitive.
|
470
504
|
*
|
471
|
-
* If this field is unrecognizable, an
|
505
|
+
* If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
472
506
|
* @param {google.cloud.discoveryengine.v1beta.UserInfo} request.userInfo
|
473
507
|
* Information about the end user.
|
474
|
-
* Highly recommended for analytics.
|
475
|
-
*
|
508
|
+
* Highly recommended for analytics.
|
509
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.UserInfo.user_agent|UserInfo.user_agent}
|
510
|
+
* is used to deduce `device_type` for analytics.
|
476
511
|
* @param {number[]} request.facetSpecs
|
477
512
|
* Facet specifications for faceted search. If empty, no facets are returned.
|
478
513
|
*
|
@@ -492,10 +527,10 @@ class SearchServiceClient {
|
|
492
527
|
* which enables image searching.
|
493
528
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec
|
494
529
|
* The query expansion specification that specifies the conditions under which
|
495
|
-
* query expansion
|
530
|
+
* query expansion occurs.
|
496
531
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec
|
497
532
|
* The spell correction specification that specifies the mode under
|
498
|
-
* which spell correction
|
533
|
+
* which spell correction takes effect.
|
499
534
|
* @param {string} request.userPseudoId
|
500
535
|
* A unique identifier for tracking visitors. For example, this could be
|
501
536
|
* implemented with an HTTP cookie, which should be able to uniquely identify
|
@@ -505,18 +540,46 @@ class SearchServiceClient {
|
|
505
540
|
* This field should NOT have a fixed value such as `unknown_visitor`.
|
506
541
|
*
|
507
542
|
* This should be the same identifier as
|
508
|
-
* {@link google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
|
543
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id}
|
509
544
|
* and
|
510
|
-
* {@link google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
|
545
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id}
|
511
546
|
*
|
512
547
|
* The field must be a UTF-8 encoded string with a length limit of 128
|
513
548
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
514
549
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
515
|
-
*
|
516
|
-
*
|
550
|
+
* A specification for configuring the behavior of content search.
|
551
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} request.embeddingSpec
|
552
|
+
* Uses the provided embedding to do additional semantic document retrieval.
|
553
|
+
* The retrieval is based on the dot product of
|
554
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.vector} and the document
|
555
|
+
* embedding that is provided in
|
556
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path}.
|
557
|
+
*
|
558
|
+
* If {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path} is not
|
559
|
+
* provided, it will use {@link protos.|ServingConfig.embedding_config.field_paths}.
|
560
|
+
* @param {string} request.rankingExpression
|
561
|
+
* The ranking expression controls the customized ranking on retrieval
|
562
|
+
* documents. This overrides {@link protos.|ServingConfig.ranking_expression}.
|
563
|
+
* The ranking expression is a single function or multiple functions that are
|
564
|
+
* joint by "+".
|
565
|
+
* * ranking_expression = function, { " + ", function };
|
566
|
+
* Supported functions:
|
567
|
+
* * double * relevance_score
|
568
|
+
* * double * dotProduct(embedding_field_path)
|
569
|
+
* Function variables:
|
570
|
+
* `relevance_score`: pre-defined keywords, used for measure relevance
|
571
|
+
* between query and document.
|
572
|
+
* `embedding_field_path`: the document embedding field
|
573
|
+
* used with query embedding vector.
|
574
|
+
* `dotProduct`: embedding function between embedding_field_path and query
|
575
|
+
* embedding vector.
|
576
|
+
*
|
577
|
+
* Example ranking expression:
|
578
|
+
* If document has an embedding field doc_embedding, the ranking expression
|
579
|
+
* could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
517
580
|
* @param {boolean} request.safeSearch
|
518
581
|
* Whether to turn on safe search. This is only supported for
|
519
|
-
*
|
582
|
+
* website search.
|
520
583
|
* @param {number[]} request.userLabels
|
521
584
|
* The user labels applied to a resource must meet the following requirements:
|
522
585
|
*
|
@@ -538,12 +601,11 @@ class SearchServiceClient {
|
|
538
601
|
* @param {object} [options]
|
539
602
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
540
603
|
* @returns {Object}
|
541
|
-
* An iterable Object that allows
|
604
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
542
605
|
* When you iterate the returned iterable, each element will be an object representing
|
543
|
-
* {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult
|
606
|
+
* {@link protos.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult|SearchResult}. The API will be called under the hood as needed, once per the page,
|
544
607
|
* so you can stop the iteration when you don't need more results.
|
545
|
-
* Please see the
|
546
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
608
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
547
609
|
* for more details and examples.
|
548
610
|
* @example <caption>include:samples/generated/v1beta/search_service.search.js</caption>
|
549
611
|
* region_tag:discoveryengine_v1beta_generated_SearchService_Search_async
|
@@ -563,6 +625,61 @@ class SearchServiceClient {
|
|
563
625
|
this.initialize();
|
564
626
|
return this.descriptors.page.search.asyncIterate(this.innerApiCalls['search'], request, callSettings);
|
565
627
|
}
|
628
|
+
/**
|
629
|
+
* Gets information about a location.
|
630
|
+
*
|
631
|
+
* @param {Object} request
|
632
|
+
* The request object that will be sent.
|
633
|
+
* @param {string} request.name
|
634
|
+
* Resource name for the location.
|
635
|
+
* @param {object} [options]
|
636
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
637
|
+
* @returns {Promise} - The promise which resolves to an array.
|
638
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
639
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
640
|
+
* for more details and examples.
|
641
|
+
* @example
|
642
|
+
* ```
|
643
|
+
* const [response] = await client.getLocation(request);
|
644
|
+
* ```
|
645
|
+
*/
|
646
|
+
getLocation(request, options, callback) {
|
647
|
+
return this.locationsClient.getLocation(request, options, callback);
|
648
|
+
}
|
649
|
+
/**
|
650
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
651
|
+
*
|
652
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
653
|
+
* @param {Object} request
|
654
|
+
* The request object that will be sent.
|
655
|
+
* @param {string} request.name
|
656
|
+
* The resource that owns the locations collection, if applicable.
|
657
|
+
* @param {string} request.filter
|
658
|
+
* The standard list filter.
|
659
|
+
* @param {number} request.pageSize
|
660
|
+
* The standard list page size.
|
661
|
+
* @param {string} request.pageToken
|
662
|
+
* The standard list page token.
|
663
|
+
* @param {object} [options]
|
664
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
665
|
+
* @returns {Object}
|
666
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
667
|
+
* When you iterate the returned iterable, each element will be an object representing
|
668
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
669
|
+
* so you can stop the iteration when you don't need more results.
|
670
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
671
|
+
* for more details and examples.
|
672
|
+
* @example
|
673
|
+
* ```
|
674
|
+
* const iterable = client.listLocationsAsync(request);
|
675
|
+
* for await (const response of iterable) {
|
676
|
+
* // process response
|
677
|
+
* }
|
678
|
+
* ```
|
679
|
+
*/
|
680
|
+
listLocationsAsync(request, options) {
|
681
|
+
return this.locationsClient.listLocationsAsync(request, options);
|
682
|
+
}
|
566
683
|
// --------------------
|
567
684
|
// -- Path templates --
|
568
685
|
// --------------------
|
@@ -716,6 +833,75 @@ class SearchServiceClient {
|
|
716
833
|
matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
|
717
834
|
return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
|
718
835
|
}
|
836
|
+
/**
|
837
|
+
* Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string.
|
838
|
+
*
|
839
|
+
* @param {string} project
|
840
|
+
* @param {string} location
|
841
|
+
* @param {string} collection
|
842
|
+
* @param {string} data_store
|
843
|
+
* @param {string} conversation
|
844
|
+
* @returns {string} Resource name string.
|
845
|
+
*/
|
846
|
+
projectLocationCollectionDataStoreConversationPath(project, location, collection, dataStore, conversation) {
|
847
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render({
|
848
|
+
project: project,
|
849
|
+
location: location,
|
850
|
+
collection: collection,
|
851
|
+
data_store: dataStore,
|
852
|
+
conversation: conversation,
|
853
|
+
});
|
854
|
+
}
|
855
|
+
/**
|
856
|
+
* Parse the project from ProjectLocationCollectionDataStoreConversation resource.
|
857
|
+
*
|
858
|
+
* @param {string} projectLocationCollectionDataStoreConversationName
|
859
|
+
* A fully-qualified path representing project_location_collection_data_store_conversation resource.
|
860
|
+
* @returns {string} A string representing the project.
|
861
|
+
*/
|
862
|
+
matchProjectFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
|
863
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).project;
|
864
|
+
}
|
865
|
+
/**
|
866
|
+
* Parse the location from ProjectLocationCollectionDataStoreConversation resource.
|
867
|
+
*
|
868
|
+
* @param {string} projectLocationCollectionDataStoreConversationName
|
869
|
+
* A fully-qualified path representing project_location_collection_data_store_conversation resource.
|
870
|
+
* @returns {string} A string representing the location.
|
871
|
+
*/
|
872
|
+
matchLocationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
|
873
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).location;
|
874
|
+
}
|
875
|
+
/**
|
876
|
+
* Parse the collection from ProjectLocationCollectionDataStoreConversation resource.
|
877
|
+
*
|
878
|
+
* @param {string} projectLocationCollectionDataStoreConversationName
|
879
|
+
* A fully-qualified path representing project_location_collection_data_store_conversation resource.
|
880
|
+
* @returns {string} A string representing the collection.
|
881
|
+
*/
|
882
|
+
matchCollectionFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
|
883
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).collection;
|
884
|
+
}
|
885
|
+
/**
|
886
|
+
* Parse the data_store from ProjectLocationCollectionDataStoreConversation resource.
|
887
|
+
*
|
888
|
+
* @param {string} projectLocationCollectionDataStoreConversationName
|
889
|
+
* A fully-qualified path representing project_location_collection_data_store_conversation resource.
|
890
|
+
* @returns {string} A string representing the data_store.
|
891
|
+
*/
|
892
|
+
matchDataStoreFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
|
893
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).data_store;
|
894
|
+
}
|
895
|
+
/**
|
896
|
+
* Parse the conversation from ProjectLocationCollectionDataStoreConversation resource.
|
897
|
+
*
|
898
|
+
* @param {string} projectLocationCollectionDataStoreConversationName
|
899
|
+
* A fully-qualified path representing project_location_collection_data_store_conversation resource.
|
900
|
+
* @returns {string} A string representing the conversation.
|
901
|
+
*/
|
902
|
+
matchConversationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
|
903
|
+
return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).conversation;
|
904
|
+
}
|
719
905
|
/**
|
720
906
|
* Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
|
721
907
|
*
|
@@ -980,6 +1166,63 @@ class SearchServiceClient {
|
|
980
1166
|
matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
|
981
1167
|
return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
|
982
1168
|
}
|
1169
|
+
/**
|
1170
|
+
* Return a fully-qualified projectLocationDataStoreConversation resource name string.
|
1171
|
+
*
|
1172
|
+
* @param {string} project
|
1173
|
+
* @param {string} location
|
1174
|
+
* @param {string} data_store
|
1175
|
+
* @param {string} conversation
|
1176
|
+
* @returns {string} Resource name string.
|
1177
|
+
*/
|
1178
|
+
projectLocationDataStoreConversationPath(project, location, dataStore, conversation) {
|
1179
|
+
return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.render({
|
1180
|
+
project: project,
|
1181
|
+
location: location,
|
1182
|
+
data_store: dataStore,
|
1183
|
+
conversation: conversation,
|
1184
|
+
});
|
1185
|
+
}
|
1186
|
+
/**
|
1187
|
+
* Parse the project from ProjectLocationDataStoreConversation resource.
|
1188
|
+
*
|
1189
|
+
* @param {string} projectLocationDataStoreConversationName
|
1190
|
+
* A fully-qualified path representing project_location_data_store_conversation resource.
|
1191
|
+
* @returns {string} A string representing the project.
|
1192
|
+
*/
|
1193
|
+
matchProjectFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
|
1194
|
+
return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).project;
|
1195
|
+
}
|
1196
|
+
/**
|
1197
|
+
* Parse the location from ProjectLocationDataStoreConversation resource.
|
1198
|
+
*
|
1199
|
+
* @param {string} projectLocationDataStoreConversationName
|
1200
|
+
* A fully-qualified path representing project_location_data_store_conversation resource.
|
1201
|
+
* @returns {string} A string representing the location.
|
1202
|
+
*/
|
1203
|
+
matchLocationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
|
1204
|
+
return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).location;
|
1205
|
+
}
|
1206
|
+
/**
|
1207
|
+
* Parse the data_store from ProjectLocationDataStoreConversation resource.
|
1208
|
+
*
|
1209
|
+
* @param {string} projectLocationDataStoreConversationName
|
1210
|
+
* A fully-qualified path representing project_location_data_store_conversation resource.
|
1211
|
+
* @returns {string} A string representing the data_store.
|
1212
|
+
*/
|
1213
|
+
matchDataStoreFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
|
1214
|
+
return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).data_store;
|
1215
|
+
}
|
1216
|
+
/**
|
1217
|
+
* Parse the conversation from ProjectLocationDataStoreConversation resource.
|
1218
|
+
*
|
1219
|
+
* @param {string} projectLocationDataStoreConversationName
|
1220
|
+
* A fully-qualified path representing project_location_data_store_conversation resource.
|
1221
|
+
* @returns {string} A string representing the conversation.
|
1222
|
+
*/
|
1223
|
+
matchConversationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
|
1224
|
+
return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).conversation;
|
1225
|
+
}
|
983
1226
|
/**
|
984
1227
|
* Return a fully-qualified projectLocationDataStoreSchema resource name string.
|
985
1228
|
*
|
@@ -1105,6 +1348,7 @@ class SearchServiceClient {
|
|
1105
1348
|
return this.searchServiceStub.then(stub => {
|
1106
1349
|
this._terminated = true;
|
1107
1350
|
stub.close();
|
1351
|
+
this.locationsClient.close();
|
1108
1352
|
});
|
1109
1353
|
}
|
1110
1354
|
return Promise.resolve();
|