@google-cloud/discoveryengine 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +7 -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 +6 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +9 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +25 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +115 -3
- package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -0
- package/build/protos/protos.d.ts +10140 -6536
- package/build/protos/protos.js +26499 -17277
- package/build/protos/protos.json +2311 -1440
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -1
- package/build/src/v1/completion_service_client.d.ts +156 -6
- 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 +165 -18
- package/build/src/v1/document_service_client.js +215 -11
- 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 +148 -4
- package/build/src/v1/schema_service_client.js +207 -5
- package/build/src/v1/search_service_client.d.ts +238 -28
- package/build/src/v1/search_service_client.js +248 -20
- package/build/src/v1/user_event_service_client.d.ts +153 -9
- package/build/src/v1/user_event_service_client.js +207 -5
- package/build/src/v1beta/completion_service_client.d.ts +55 -4
- package/build/src/v1beta/completion_service_client.js +60 -4
- package/build/src/v1beta/conversational_search_service_client.d.ts +75 -4
- package/build/src/v1beta/conversational_search_service_client.js +60 -4
- package/build/src/v1beta/document_service_client.d.ts +55 -4
- package/build/src/v1beta/document_service_client.js +61 -5
- package/build/src/v1beta/recommendation_service_client.d.ts +55 -4
- package/build/src/v1beta/recommendation_service_client.js +60 -4
- package/build/src/v1beta/schema_service_client.d.ts +55 -4
- package/build/src/v1beta/schema_service_client.js +61 -5
- package/build/src/v1beta/search_service_client.d.ts +142 -4
- package/build/src/v1beta/search_service_client.js +118 -4
- package/build/src/v1beta/user_event_service_client.d.ts +55 -4
- package/build/src/v1beta/user_event_service_client.js +61 -5
- package/package.json +3 -3
@@ -60,8 +60,7 @@ class SchemaServiceClient {
|
|
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 SchemaServiceClient {
|
|
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 SchemaServiceClient({fallback:
|
71
|
+
* const client = new SchemaServiceClient({fallback: true}, gax);
|
73
72
|
* ```
|
74
73
|
*/
|
75
74
|
constructor(opts, gaxInstance) {
|
@@ -115,6 +114,7 @@ class SchemaServiceClient {
|
|
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 SchemaServiceClient {
|
|
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) {
|
@@ -161,7 +161,7 @@ class SchemaServiceClient {
|
|
161
161
|
auth: this.auth,
|
162
162
|
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
|
163
163
|
};
|
164
|
-
if (opts.fallback
|
164
|
+
if (opts.fallback) {
|
165
165
|
lroOptions.protoJson = protoFilesRoot;
|
166
166
|
lroOptions.httpRules = [
|
167
167
|
{
|
@@ -613,6 +613,61 @@ class SchemaServiceClient {
|
|
613
613
|
this.initialize();
|
614
614
|
return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
|
615
615
|
}
|
616
|
+
/**
|
617
|
+
* Gets information about a location.
|
618
|
+
*
|
619
|
+
* @param {Object} request
|
620
|
+
* The request object that will be sent.
|
621
|
+
* @param {string} request.name
|
622
|
+
* Resource name for the location.
|
623
|
+
* @param {object} [options]
|
624
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
625
|
+
* @returns {Promise} - The promise which resolves to an array.
|
626
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
627
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
628
|
+
* for more details and examples.
|
629
|
+
* @example
|
630
|
+
* ```
|
631
|
+
* const [response] = await client.getLocation(request);
|
632
|
+
* ```
|
633
|
+
*/
|
634
|
+
getLocation(request, options, callback) {
|
635
|
+
return this.locationsClient.getLocation(request, options, callback);
|
636
|
+
}
|
637
|
+
/**
|
638
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
639
|
+
*
|
640
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
641
|
+
* @param {Object} request
|
642
|
+
* The request object that will be sent.
|
643
|
+
* @param {string} request.name
|
644
|
+
* The resource that owns the locations collection, if applicable.
|
645
|
+
* @param {string} request.filter
|
646
|
+
* The standard list filter.
|
647
|
+
* @param {number} request.pageSize
|
648
|
+
* The standard list page size.
|
649
|
+
* @param {string} request.pageToken
|
650
|
+
* The standard list page token.
|
651
|
+
* @param {object} [options]
|
652
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
653
|
+
* @returns {Object}
|
654
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
655
|
+
* When you iterate the returned iterable, each element will be an object representing
|
656
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
657
|
+
* so you can stop the iteration when you don't need more results.
|
658
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
659
|
+
* for more details and examples.
|
660
|
+
* @example
|
661
|
+
* ```
|
662
|
+
* const iterable = client.listLocationsAsync(request);
|
663
|
+
* for await (const response of iterable) {
|
664
|
+
* // process response
|
665
|
+
* }
|
666
|
+
* ```
|
667
|
+
*/
|
668
|
+
listLocationsAsync(request, options) {
|
669
|
+
return this.locationsClient.listLocationsAsync(request, options);
|
670
|
+
}
|
616
671
|
/**
|
617
672
|
* Gets the latest state of a long-running operation. Clients can use this
|
618
673
|
* method to poll the operation result at intervals as recommended by the API
|
@@ -1259,6 +1314,7 @@ class SchemaServiceClient {
|
|
1259
1314
|
return this.schemaServiceStub.then(stub => {
|
1260
1315
|
this._terminated = true;
|
1261
1316
|
stub.close();
|
1317
|
+
this.locationsClient.close();
|
1262
1318
|
this.operationsClient.close();
|
1263
1319
|
});
|
1264
1320
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import type * as gax from 'google-gax';
|
3
|
-
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
|
3
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, LocationsClient, LocationProtos } from 'google-gax';
|
4
4
|
import { Transform } from 'stream';
|
5
5
|
import * as protos from '../../protos/protos';
|
6
6
|
/**
|
@@ -22,6 +22,7 @@ export declare class SearchServiceClient {
|
|
22
22
|
innerApiCalls: {
|
23
23
|
[name: string]: Function;
|
24
24
|
};
|
25
|
+
locationsClient: LocationsClient;
|
25
26
|
pathTemplates: {
|
26
27
|
[name: string]: gax.PathTemplate;
|
27
28
|
};
|
@@ -56,8 +57,7 @@ export declare class SearchServiceClient {
|
|
56
57
|
* API remote host.
|
57
58
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
58
59
|
* Follows the structure of {@link gapicConfig}.
|
59
|
-
* @param {boolean
|
60
|
-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
60
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
61
61
|
* For more information, please check the
|
62
62
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
63
63
|
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
@@ -65,7 +65,7 @@ export declare class SearchServiceClient {
|
|
65
65
|
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
66
66
|
* ```
|
67
67
|
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
68
|
-
* const client = new SearchServiceClient({fallback:
|
68
|
+
* const client = new SearchServiceClient({fallback: true}, gax);
|
69
69
|
* ```
|
70
70
|
*/
|
71
71
|
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
@@ -209,6 +209,35 @@ export declare class SearchServiceClient {
|
|
209
209
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
210
210
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
211
211
|
* A specification for configuring the behavior of content search.
|
212
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} request.embeddingSpec
|
213
|
+
* Uses the provided embedding to do additional semantic document retrieval.
|
214
|
+
* The retrieval is based on the dot product of
|
215
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.vector} and the document
|
216
|
+
* embedding that is provided in
|
217
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path}.
|
218
|
+
*
|
219
|
+
* If {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path} is not
|
220
|
+
* provided, it will use {@link protos.|ServingConfig.embedding_config.field_paths}.
|
221
|
+
* @param {string} request.rankingExpression
|
222
|
+
* The ranking expression controls the customized ranking on retrieval
|
223
|
+
* documents. This overrides {@link protos.|ServingConfig.ranking_expression}.
|
224
|
+
* The ranking expression is a single function or multiple functions that are
|
225
|
+
* joint by "+".
|
226
|
+
* * ranking_expression = function, { " + ", function };
|
227
|
+
* Supported functions:
|
228
|
+
* * double * relevance_score
|
229
|
+
* * double * dotProduct(embedding_field_path)
|
230
|
+
* Function variables:
|
231
|
+
* `relevance_score`: pre-defined keywords, used for measure relevance
|
232
|
+
* between query and document.
|
233
|
+
* `embedding_field_path`: the document embedding field
|
234
|
+
* used with query embedding vector.
|
235
|
+
* `dotProduct`: embedding function between embedding_field_path and query
|
236
|
+
* embedding vector.
|
237
|
+
*
|
238
|
+
* Example ranking expression:
|
239
|
+
* If document has an embedding field doc_embedding, the ranking expression
|
240
|
+
* could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
212
241
|
* @param {boolean} request.safeSearch
|
213
242
|
* Whether to turn on safe search. This is only supported for
|
214
243
|
* website search.
|
@@ -350,6 +379,35 @@ export declare class SearchServiceClient {
|
|
350
379
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
351
380
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
352
381
|
* A specification for configuring the behavior of content search.
|
382
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} request.embeddingSpec
|
383
|
+
* Uses the provided embedding to do additional semantic document retrieval.
|
384
|
+
* The retrieval is based on the dot product of
|
385
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.vector} and the document
|
386
|
+
* embedding that is provided in
|
387
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path}.
|
388
|
+
*
|
389
|
+
* If {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path} is not
|
390
|
+
* provided, it will use {@link protos.|ServingConfig.embedding_config.field_paths}.
|
391
|
+
* @param {string} request.rankingExpression
|
392
|
+
* The ranking expression controls the customized ranking on retrieval
|
393
|
+
* documents. This overrides {@link protos.|ServingConfig.ranking_expression}.
|
394
|
+
* The ranking expression is a single function or multiple functions that are
|
395
|
+
* joint by "+".
|
396
|
+
* * ranking_expression = function, { " + ", function };
|
397
|
+
* Supported functions:
|
398
|
+
* * double * relevance_score
|
399
|
+
* * double * dotProduct(embedding_field_path)
|
400
|
+
* Function variables:
|
401
|
+
* `relevance_score`: pre-defined keywords, used for measure relevance
|
402
|
+
* between query and document.
|
403
|
+
* `embedding_field_path`: the document embedding field
|
404
|
+
* used with query embedding vector.
|
405
|
+
* `dotProduct`: embedding function between embedding_field_path and query
|
406
|
+
* embedding vector.
|
407
|
+
*
|
408
|
+
* Example ranking expression:
|
409
|
+
* If document has an embedding field doc_embedding, the ranking expression
|
410
|
+
* could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
353
411
|
* @param {boolean} request.safeSearch
|
354
412
|
* Whether to turn on safe search. This is only supported for
|
355
413
|
* website search.
|
@@ -486,6 +544,35 @@ export declare class SearchServiceClient {
|
|
486
544
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
487
545
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
488
546
|
* A specification for configuring the behavior of content search.
|
547
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} request.embeddingSpec
|
548
|
+
* Uses the provided embedding to do additional semantic document retrieval.
|
549
|
+
* The retrieval is based on the dot product of
|
550
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.vector} and the document
|
551
|
+
* embedding that is provided in
|
552
|
+
* {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path}.
|
553
|
+
*
|
554
|
+
* If {@link protos.|SearchRequest.embedding_spec.embedding_vectors.field_path} is not
|
555
|
+
* provided, it will use {@link protos.|ServingConfig.embedding_config.field_paths}.
|
556
|
+
* @param {string} request.rankingExpression
|
557
|
+
* The ranking expression controls the customized ranking on retrieval
|
558
|
+
* documents. This overrides {@link protos.|ServingConfig.ranking_expression}.
|
559
|
+
* The ranking expression is a single function or multiple functions that are
|
560
|
+
* joint by "+".
|
561
|
+
* * ranking_expression = function, { " + ", function };
|
562
|
+
* Supported functions:
|
563
|
+
* * double * relevance_score
|
564
|
+
* * double * dotProduct(embedding_field_path)
|
565
|
+
* Function variables:
|
566
|
+
* `relevance_score`: pre-defined keywords, used for measure relevance
|
567
|
+
* between query and document.
|
568
|
+
* `embedding_field_path`: the document embedding field
|
569
|
+
* used with query embedding vector.
|
570
|
+
* `dotProduct`: embedding function between embedding_field_path and query
|
571
|
+
* embedding vector.
|
572
|
+
*
|
573
|
+
* Example ranking expression:
|
574
|
+
* If document has an embedding field doc_embedding, the ranking expression
|
575
|
+
* could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
489
576
|
* @param {boolean} request.safeSearch
|
490
577
|
* Whether to turn on safe search. This is only supported for
|
491
578
|
* website search.
|
@@ -520,6 +607,57 @@ export declare class SearchServiceClient {
|
|
520
607
|
* region_tag:discoveryengine_v1beta_generated_SearchService_Search_async
|
521
608
|
*/
|
522
609
|
searchAsync(request?: protos.google.cloud.discoveryengine.v1beta.ISearchRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1beta.SearchResponse.ISearchResult>;
|
610
|
+
/**
|
611
|
+
* Gets information about a location.
|
612
|
+
*
|
613
|
+
* @param {Object} request
|
614
|
+
* The request object that will be sent.
|
615
|
+
* @param {string} request.name
|
616
|
+
* Resource name for the location.
|
617
|
+
* @param {object} [options]
|
618
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
619
|
+
* @returns {Promise} - The promise which resolves to an array.
|
620
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
621
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
622
|
+
* for more details and examples.
|
623
|
+
* @example
|
624
|
+
* ```
|
625
|
+
* const [response] = await client.getLocation(request);
|
626
|
+
* ```
|
627
|
+
*/
|
628
|
+
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>;
|
629
|
+
/**
|
630
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
631
|
+
*
|
632
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
633
|
+
* @param {Object} request
|
634
|
+
* The request object that will be sent.
|
635
|
+
* @param {string} request.name
|
636
|
+
* The resource that owns the locations collection, if applicable.
|
637
|
+
* @param {string} request.filter
|
638
|
+
* The standard list filter.
|
639
|
+
* @param {number} request.pageSize
|
640
|
+
* The standard list page size.
|
641
|
+
* @param {string} request.pageToken
|
642
|
+
* The standard list page token.
|
643
|
+
* @param {object} [options]
|
644
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
645
|
+
* @returns {Object}
|
646
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
647
|
+
* When you iterate the returned iterable, each element will be an object representing
|
648
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
649
|
+
* so you can stop the iteration when you don't need more results.
|
650
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
651
|
+
* for more details and examples.
|
652
|
+
* @example
|
653
|
+
* ```
|
654
|
+
* const iterable = client.listLocationsAsync(request);
|
655
|
+
* for await (const response of iterable) {
|
656
|
+
* // process response
|
657
|
+
* }
|
658
|
+
* ```
|
659
|
+
*/
|
660
|
+
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
523
661
|
/**
|
524
662
|
* Return a fully-qualified projectLocationCollectionDataStoreBranch resource name string.
|
525
663
|
*
|
@@ -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) {
|
@@ -369,6 +369,35 @@ class SearchServiceClient {
|
|
369
369
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
370
370
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
371
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)`.
|
372
401
|
* @param {boolean} request.safeSearch
|
373
402
|
* Whether to turn on safe search. This is only supported for
|
374
403
|
* website search.
|
@@ -519,6 +548,35 @@ class SearchServiceClient {
|
|
519
548
|
* characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
520
549
|
* @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec
|
521
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)`.
|
522
580
|
* @param {boolean} request.safeSearch
|
523
581
|
* Whether to turn on safe search. This is only supported for
|
524
582
|
* website search.
|
@@ -567,6 +625,61 @@ class SearchServiceClient {
|
|
567
625
|
this.initialize();
|
568
626
|
return this.descriptors.page.search.asyncIterate(this.innerApiCalls['search'], request, callSettings);
|
569
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
|
+
}
|
570
683
|
// --------------------
|
571
684
|
// -- Path templates --
|
572
685
|
// --------------------
|
@@ -1235,6 +1348,7 @@ class SearchServiceClient {
|
|
1235
1348
|
return this.searchServiceStub.then(stub => {
|
1236
1349
|
this._terminated = true;
|
1237
1350
|
stub.close();
|
1351
|
+
this.locationsClient.close();
|
1238
1352
|
});
|
1239
1353
|
}
|
1240
1354
|
return Promise.resolve();
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type * as gax from 'google-gax';
|
2
|
-
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
|
2
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, LocationsClient, LocationProtos } from 'google-gax';
|
3
3
|
import * as protos from '../../protos/protos';
|
4
4
|
/**
|
5
5
|
* Service for ingesting end user actions on a website to Discovery Engine API.
|
@@ -20,6 +20,7 @@ export declare class UserEventServiceClient {
|
|
20
20
|
innerApiCalls: {
|
21
21
|
[name: string]: Function;
|
22
22
|
};
|
23
|
+
locationsClient: LocationsClient;
|
23
24
|
pathTemplates: {
|
24
25
|
[name: string]: gax.PathTemplate;
|
25
26
|
};
|
@@ -55,8 +56,7 @@ export declare class UserEventServiceClient {
|
|
55
56
|
* API remote host.
|
56
57
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
57
58
|
* Follows the structure of {@link gapicConfig}.
|
58
|
-
* @param {boolean
|
59
|
-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
59
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
60
60
|
* For more information, please check the
|
61
61
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
62
62
|
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
@@ -64,7 +64,7 @@ export declare class UserEventServiceClient {
|
|
64
64
|
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
65
65
|
* ```
|
66
66
|
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
67
|
-
* const client = new UserEventServiceClient({fallback:
|
67
|
+
* const client = new UserEventServiceClient({fallback: true}, gax);
|
68
68
|
* ```
|
69
69
|
*/
|
70
70
|
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
@@ -225,6 +225,57 @@ export declare class UserEventServiceClient {
|
|
225
225
|
* region_tag:discoveryengine_v1beta_generated_UserEventService_ImportUserEvents_async
|
226
226
|
*/
|
227
227
|
checkImportUserEventsProgress(name: string): Promise<LROperation<protos.google.cloud.discoveryengine.v1beta.ImportUserEventsResponse, protos.google.cloud.discoveryengine.v1beta.ImportUserEventsMetadata>>;
|
228
|
+
/**
|
229
|
+
* Gets information about a location.
|
230
|
+
*
|
231
|
+
* @param {Object} request
|
232
|
+
* The request object that will be sent.
|
233
|
+
* @param {string} request.name
|
234
|
+
* Resource name for the location.
|
235
|
+
* @param {object} [options]
|
236
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
237
|
+
* @returns {Promise} - The promise which resolves to an array.
|
238
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
239
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
240
|
+
* for more details and examples.
|
241
|
+
* @example
|
242
|
+
* ```
|
243
|
+
* const [response] = await client.getLocation(request);
|
244
|
+
* ```
|
245
|
+
*/
|
246
|
+
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>;
|
247
|
+
/**
|
248
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
249
|
+
*
|
250
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
251
|
+
* @param {Object} request
|
252
|
+
* The request object that will be sent.
|
253
|
+
* @param {string} request.name
|
254
|
+
* The resource that owns the locations collection, if applicable.
|
255
|
+
* @param {string} request.filter
|
256
|
+
* The standard list filter.
|
257
|
+
* @param {number} request.pageSize
|
258
|
+
* The standard list page size.
|
259
|
+
* @param {string} request.pageToken
|
260
|
+
* The standard list page token.
|
261
|
+
* @param {object} [options]
|
262
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
263
|
+
* @returns {Object}
|
264
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
265
|
+
* When you iterate the returned iterable, each element will be an object representing
|
266
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
267
|
+
* so you can stop the iteration when you don't need more results.
|
268
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
269
|
+
* for more details and examples.
|
270
|
+
* @example
|
271
|
+
* ```
|
272
|
+
* const iterable = client.listLocationsAsync(request);
|
273
|
+
* for await (const response of iterable) {
|
274
|
+
* // process response
|
275
|
+
* }
|
276
|
+
* ```
|
277
|
+
*/
|
278
|
+
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
228
279
|
/**
|
229
280
|
* Gets the latest state of a long-running operation. Clients can use this
|
230
281
|
* method to poll the operation result at intervals as recommended by the API
|