@maxim_mazurok/gapi.client.discoveryengine-v1beta 0.0.20230928 → 0.0.20231016

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.
Files changed (3) hide show
  1. package/index.d.ts +195 -13
  2. package/package.json +1 -1
  3. package/tests.ts +192 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://discoveryengine.googleapis.com/$discovery/rest?version=v1beta
12
- // Revision: 20230928
12
+ // Revision: 20231016
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -104,11 +104,6 @@ declare namespace gapi.client {
104
104
  functionName?:
105
105
  string;
106
106
  }
107
- interface GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse {
108
- /** TargetSites created. */
109
- targetSites?:
110
- GoogleCloudDiscoveryengineV1alphaTargetSite[];
111
- }
112
107
  interface GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata {
113
108
  /** Operation create time. */
114
109
  createTime?:
@@ -921,9 +916,11 @@ declare namespace gapi.client {
921
916
  interface GoogleCloudDiscoveryengineV1betaRecommendRequest {
922
917
  /**
923
918
  * Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the `filter_tags` attribute is supported. Examples: *
924
- * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))` If your filter blocks all results,
925
- * the API will return generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to True in RecommendRequest.params to
926
- * receive empty results instead. Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
919
+ * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))` If `attributeFilteringSyntax` is set
920
+ * to true under the `params` field, then attribute-based expressions are expected instead of the above described tag-based syntax. Examples: * (launguage: ANY("en", "es")) AND NOT
921
+ * (categories: ANY("Movie")) * (available: true) AND (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) If your filter blocks all results, the API will return generic
922
+ * (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to True in RecommendRequest.params to receive empty results instead.
923
+ * Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
927
924
  */
928
925
  filter?:
929
926
  string;
@@ -939,7 +936,8 @@ declare namespace gapi.client {
939
936
  * RecommendResponse.RecommendationResult.metadata. The given 'score' indicates the probability of a Document conversion given the user's context and history. * `strictFiltering`:
940
937
  * Boolean. True by default. If set to false, the service will return generic (unfiltered) popular Documents instead of empty if your filter blocks all recommendation results. *
941
938
  * `diversityLevel`: String. Default empty. If set to be non-empty, then it needs to be one of: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` *
942
- * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category.
939
+ * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category. * `attributeFilteringSyntax`: Boolean. False by default. If set to
940
+ * true, the `filter` field is interpreted according to the new, attribute-based syntax.
943
941
  */
944
942
  params?:
945
943
  { [P in string]: any };
@@ -1055,7 +1053,7 @@ declare namespace gapi.client {
1055
1053
  string;
1056
1054
  }
1057
1055
  interface GoogleCloudDiscoveryengineV1betaSearchRequest {
1058
- /** Boost specification to boost certain documents. */
1056
+ /** Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) */
1059
1057
  boostSpec?:
1060
1058
  GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec;
1061
1059
  /**
@@ -1079,7 +1077,10 @@ declare namespace gapi.client {
1079
1077
  GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec[];
1080
1078
  /**
1081
1079
  * The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If
1082
- * this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
1080
+ * this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI
1081
+ * Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look
1082
+ * like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see
1083
+ * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
1083
1084
  */
1084
1085
  filter?:
1085
1086
  string;
@@ -1094,7 +1095,8 @@ declare namespace gapi.client {
1094
1095
  number;
1095
1096
  /**
1096
1097
  * The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is
1097
- * case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
1098
+ * case-sensitive. For more information on ordering, see [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) If this field is unrecognizable, an `INVALID_ARGUMENT`
1099
+ * is returned.
1098
1100
  */
1099
1101
  orderBy?:
1100
1102
  string;
@@ -4190,9 +4192,189 @@ declare namespace gapi.client {
4190
4192
  string;
4191
4193
  }): Request<GoogleLongrunningListOperationsResponse>;
4192
4194
  }
4195
+ interface ServingConfigsResource {
4196
+ /** Makes a recommendation, which requires a contextual user event. */
4197
+ recommend(request: {
4198
+ /** V1 error format. */
4199
+ "$.xgafv"?:
4200
+ string;
4201
+ /** OAuth access token. */
4202
+ access_token?:
4203
+ string;
4204
+ /** Data format for response. */
4205
+ alt?:
4206
+ string;
4207
+ /** JSONP */
4208
+ callback?:
4209
+ string;
4210
+ /** Selector specifying which fields to include in a partial response. */
4211
+ fields?:
4212
+ string;
4213
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
4214
+ key?:
4215
+ string;
4216
+ /** OAuth 2.0 token for the current user. */
4217
+ oauth_token?:
4218
+ string;
4219
+ /** Returns response with indentations and line breaks. */
4220
+ prettyPrint?:
4221
+ boolean;
4222
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
4223
+ quotaUser?:
4224
+ string;
4225
+ /**
4226
+ * Required. Full resource name of the format: `projects/*‍/locations/global/collections/*‍/dataStores/*‍/servingConfigs/*` Before you can request recommendations from your model,
4227
+ * you must create at least one serving config for it.
4228
+ */
4229
+ servingConfig:
4230
+ string;
4231
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
4232
+ upload_protocol?:
4233
+ string;
4234
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
4235
+ uploadType?:
4236
+ string;
4237
+ /** Request body */
4238
+ resource:
4239
+ GoogleCloudDiscoveryengineV1betaRecommendRequest;
4240
+ }): Request<GoogleCloudDiscoveryengineV1betaRecommendResponse>;
4241
+ recommend(request: {
4242
+ /** V1 error format. */
4243
+ "$.xgafv"?:
4244
+ string;
4245
+ /** OAuth access token. */
4246
+ access_token?:
4247
+ string;
4248
+ /** Data format for response. */
4249
+ alt?:
4250
+ string;
4251
+ /** JSONP */
4252
+ callback?:
4253
+ string;
4254
+ /** Selector specifying which fields to include in a partial response. */
4255
+ fields?:
4256
+ string;
4257
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
4258
+ key?:
4259
+ string;
4260
+ /** OAuth 2.0 token for the current user. */
4261
+ oauth_token?:
4262
+ string;
4263
+ /** Returns response with indentations and line breaks. */
4264
+ prettyPrint?:
4265
+ boolean;
4266
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
4267
+ quotaUser?:
4268
+ string;
4269
+ /**
4270
+ * Required. Full resource name of the format: `projects/*‍/locations/global/collections/*‍/dataStores/*‍/servingConfigs/*` Before you can request recommendations from your model,
4271
+ * you must create at least one serving config for it.
4272
+ */
4273
+ servingConfig:
4274
+ string;
4275
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
4276
+ upload_protocol?:
4277
+ string;
4278
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
4279
+ uploadType?:
4280
+ string;
4281
+ },
4282
+ body: GoogleCloudDiscoveryengineV1betaRecommendRequest): Request<GoogleCloudDiscoveryengineV1betaRecommendResponse>;
4283
+ /** Performs a search. */
4284
+ search(request: {
4285
+ /** V1 error format. */
4286
+ "$.xgafv"?:
4287
+ string;
4288
+ /** OAuth access token. */
4289
+ access_token?:
4290
+ string;
4291
+ /** Data format for response. */
4292
+ alt?:
4293
+ string;
4294
+ /** JSONP */
4295
+ callback?:
4296
+ string;
4297
+ /** Selector specifying which fields to include in a partial response. */
4298
+ fields?:
4299
+ string;
4300
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
4301
+ key?:
4302
+ string;
4303
+ /** OAuth 2.0 token for the current user. */
4304
+ oauth_token?:
4305
+ string;
4306
+ /** Returns response with indentations and line breaks. */
4307
+ prettyPrint?:
4308
+ boolean;
4309
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
4310
+ quotaUser?:
4311
+ string;
4312
+ /**
4313
+ * Required. The resource name of the Search serving config, such as
4314
+ * `projects/*‍/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving
4315
+ * configuration name, set of models used to make the search.
4316
+ */
4317
+ servingConfig:
4318
+ string;
4319
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
4320
+ upload_protocol?:
4321
+ string;
4322
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
4323
+ uploadType?:
4324
+ string;
4325
+ /** Request body */
4326
+ resource:
4327
+ GoogleCloudDiscoveryengineV1betaSearchRequest;
4328
+ }): Request<GoogleCloudDiscoveryengineV1betaSearchResponse>;
4329
+ search(request: {
4330
+ /** V1 error format. */
4331
+ "$.xgafv"?:
4332
+ string;
4333
+ /** OAuth access token. */
4334
+ access_token?:
4335
+ string;
4336
+ /** Data format for response. */
4337
+ alt?:
4338
+ string;
4339
+ /** JSONP */
4340
+ callback?:
4341
+ string;
4342
+ /** Selector specifying which fields to include in a partial response. */
4343
+ fields?:
4344
+ string;
4345
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
4346
+ key?:
4347
+ string;
4348
+ /** OAuth 2.0 token for the current user. */
4349
+ oauth_token?:
4350
+ string;
4351
+ /** Returns response with indentations and line breaks. */
4352
+ prettyPrint?:
4353
+ boolean;
4354
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
4355
+ quotaUser?:
4356
+ string;
4357
+ /**
4358
+ * Required. The resource name of the Search serving config, such as
4359
+ * `projects/*‍/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving
4360
+ * configuration name, set of models used to make the search.
4361
+ */
4362
+ servingConfig:
4363
+ string;
4364
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
4365
+ upload_protocol?:
4366
+ string;
4367
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
4368
+ uploadType?:
4369
+ string;
4370
+ },
4371
+ body: GoogleCloudDiscoveryengineV1betaSearchRequest): Request<GoogleCloudDiscoveryengineV1betaSearchResponse>;
4372
+ }
4193
4373
  interface EnginesResource {
4194
4374
  operations:
4195
4375
  OperationsResource;
4376
+ servingConfigs:
4377
+ ServingConfigsResource;
4196
4378
  }
4197
4379
  interface OperationsResource {
4198
4380
  /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.discoveryengine-v1beta",
3
- "version": "0.0.20230928",
3
+ "version": "0.0.20231016",
4
4
  "description": "TypeScript typings for Discovery Engine API v1beta",
5
5
  "license": "MIT",
6
6
  "author": {
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20230928
6
+ // Revision: 20231016
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -843,6 +843,197 @@ gapi.load('client', async () => {
843
843
  pageSize: 42,
844
844
  pageToken: "Test string",
845
845
  });
846
+ /** Makes a recommendation, which requires a contextual user event. */
847
+ await gapi.client.discoveryengine.projects.locations.collections.engines.servingConfigs.recommend({
848
+ servingConfig: "Test string",
849
+ }, {
850
+ filter: "Test string",
851
+ pageSize: 42,
852
+ params: {
853
+ A: 42
854
+ },
855
+ userEvent: {
856
+ attributes: {
857
+ A: {
858
+ numbers: [
859
+ 42
860
+ ],
861
+ text: [
862
+ "Test string"
863
+ ],
864
+ }
865
+ },
866
+ attributionToken: "Test string",
867
+ completionInfo: {
868
+ selectedPosition: 42,
869
+ selectedSuggestion: "Test string",
870
+ },
871
+ directUserRequest: true,
872
+ documents: [
873
+ {
874
+ id: "Test string",
875
+ name: "Test string",
876
+ promotionIds: [
877
+ "Test string"
878
+ ],
879
+ quantity: 42,
880
+ uri: "Test string",
881
+ }
882
+ ],
883
+ eventTime: "Test string",
884
+ eventType: "Test string",
885
+ filter: "Test string",
886
+ mediaInfo: {
887
+ mediaProgressDuration: "Test string",
888
+ mediaProgressPercentage: 42,
889
+ },
890
+ pageInfo: {
891
+ pageCategory: "Test string",
892
+ pageviewId: "Test string",
893
+ referrerUri: "Test string",
894
+ uri: "Test string",
895
+ },
896
+ panel: {
897
+ displayName: "Test string",
898
+ panelId: "Test string",
899
+ panelPosition: 42,
900
+ totalPanels: 42,
901
+ },
902
+ promotionIds: [
903
+ "Test string"
904
+ ],
905
+ searchInfo: {
906
+ offset: 42,
907
+ orderBy: "Test string",
908
+ searchQuery: "Test string",
909
+ },
910
+ sessionId: "Test string",
911
+ tagIds: [
912
+ "Test string"
913
+ ],
914
+ transactionInfo: {
915
+ cost: 42,
916
+ currency: "Test string",
917
+ discountValue: 42,
918
+ tax: 42,
919
+ transactionId: "Test string",
920
+ value: 42,
921
+ },
922
+ userInfo: {
923
+ userAgent: "Test string",
924
+ userId: "Test string",
925
+ },
926
+ userPseudoId: "Test string",
927
+ },
928
+ userLabels: {
929
+ A: "Test string"
930
+ },
931
+ validateOnly: true,
932
+ });
933
+ /** Performs a search. */
934
+ await gapi.client.discoveryengine.projects.locations.collections.engines.servingConfigs.search({
935
+ servingConfig: "Test string",
936
+ }, {
937
+ boostSpec: {
938
+ conditionBoostSpecs: [
939
+ {
940
+ boost: 42,
941
+ condition: "Test string",
942
+ }
943
+ ],
944
+ },
945
+ branch: "Test string",
946
+ contentSearchSpec: {
947
+ extractiveContentSpec: {
948
+ maxExtractiveAnswerCount: 42,
949
+ maxExtractiveSegmentCount: 42,
950
+ numNextSegments: 42,
951
+ numPreviousSegments: 42,
952
+ },
953
+ snippetSpec: {
954
+ maxSnippetCount: 42,
955
+ referenceOnly: true,
956
+ returnSnippet: true,
957
+ },
958
+ summarySpec: {
959
+ ignoreAdversarialQuery: true,
960
+ ignoreNonSummarySeekingQuery: true,
961
+ includeCitations: true,
962
+ languageCode: "Test string",
963
+ summaryResultCount: 42,
964
+ },
965
+ },
966
+ embeddingSpec: {
967
+ embeddingVectors: [
968
+ {
969
+ fieldPath: "Test string",
970
+ vector: [
971
+ 42
972
+ ],
973
+ }
974
+ ],
975
+ },
976
+ facetSpecs: [
977
+ {
978
+ enableDynamicPosition: true,
979
+ excludedFilterKeys: [
980
+ "Test string"
981
+ ],
982
+ facetKey: {
983
+ caseInsensitive: true,
984
+ contains: [
985
+ "Test string"
986
+ ],
987
+ intervals: [
988
+ {
989
+ exclusiveMaximum: 42,
990
+ exclusiveMinimum: 42,
991
+ maximum: 42,
992
+ minimum: 42,
993
+ }
994
+ ],
995
+ key: "Test string",
996
+ orderBy: "Test string",
997
+ prefixes: [
998
+ "Test string"
999
+ ],
1000
+ restrictedValues: [
1001
+ "Test string"
1002
+ ],
1003
+ },
1004
+ limit: 42,
1005
+ }
1006
+ ],
1007
+ filter: "Test string",
1008
+ imageQuery: {
1009
+ imageBytes: "Test string",
1010
+ },
1011
+ offset: 42,
1012
+ orderBy: "Test string",
1013
+ pageSize: 42,
1014
+ pageToken: "Test string",
1015
+ params: {
1016
+ A: 42
1017
+ },
1018
+ query: "Test string",
1019
+ queryExpansionSpec: {
1020
+ condition: "Test string",
1021
+ pinUnexpandedResults: true,
1022
+ },
1023
+ rankingExpression: "Test string",
1024
+ safeSearch: true,
1025
+ spellCorrectionSpec: {
1026
+ mode: "Test string",
1027
+ },
1028
+ userInfo: {
1029
+ userAgent: "Test string",
1030
+ userId: "Test string",
1031
+ },
1032
+ userLabels: {
1033
+ A: "Test string"
1034
+ },
1035
+ userPseudoId: "Test string",
1036
+ });
846
1037
  /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
847
1038
  await gapi.client.discoveryengine.projects.locations.collections.operations.get({
848
1039
  name: "Test string",