@maxim_mazurok/gapi.client.discoveryengine-v1alpha 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 +198 -13
  2. package/package.json +1 -1
  3. package/tests.ts +193 -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=v1alpha
12
- // Revision: 20230928
12
+ // Revision: 20231016
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -109,11 +109,6 @@ declare namespace gapi.client {
109
109
  token?:
110
110
  string;
111
111
  }
112
- interface GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse {
113
- /** TargetSites created. */
114
- targetSites?:
115
- GoogleCloudDiscoveryengineV1alphaTargetSite[];
116
- }
117
112
  interface GoogleCloudDiscoveryengineV1alphaBigQuerySource {
118
113
  /**
119
114
  * The schema to use when parsing the data from the source. Supported values for user event imports: * `user_event` (default): One UserEvent per row. Supported values for document
@@ -774,9 +769,11 @@ declare namespace gapi.client {
774
769
  interface GoogleCloudDiscoveryengineV1alphaRecommendRequest {
775
770
  /**
776
771
  * 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: *
777
- * `(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,
778
- * 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
779
- * receive empty results instead. Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
772
+ * `(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
773
+ * 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
774
+ * (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
775
+ * (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to True in RecommendRequest.params to receive empty results instead.
776
+ * Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
780
777
  */
781
778
  filter?:
782
779
  string;
@@ -792,7 +789,8 @@ declare namespace gapi.client {
792
789
  * RecommendResponse.RecommendationResult.metadata. The given 'score' indicates the probability of a Document conversion given the user's context and history. * `strictFiltering`:
793
790
  * 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. *
794
791
  * `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` *
795
- * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category.
792
+ * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category. * `attributeFilteringSyntax`: Boolean. False by default. If set to
793
+ * true, the `filter` field is interpreted according to the new, attribute-based syntax.
796
794
  */
797
795
  params?:
798
796
  { [P in string]: any };
@@ -966,7 +964,7 @@ declare namespace gapi.client {
966
964
  string;
967
965
  }
968
966
  interface GoogleCloudDiscoveryengineV1alphaSearchRequest {
969
- /** Boost specification to boost certain documents. */
967
+ /** Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) */
970
968
  boostSpec?:
971
969
  GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec;
972
970
  /**
@@ -990,7 +988,10 @@ declare namespace gapi.client {
990
988
  GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec[];
991
989
  /**
992
990
  * 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
993
- * this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
991
+ * 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
992
+ * 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
993
+ * like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see
994
+ * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
994
995
  */
995
996
  filter?:
996
997
  string;
@@ -1005,7 +1006,8 @@ declare namespace gapi.client {
1005
1006
  number;
1006
1007
  /**
1007
1008
  * 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
1008
- * case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
1009
+ * 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`
1010
+ * is returned.
1009
1011
  */
1010
1012
  orderBy?:
1011
1013
  string;
@@ -1709,6 +1711,9 @@ declare namespace gapi.client {
1709
1711
  /** Output only. Whether LLM is enabled in the corresponding data store. */
1710
1712
  llmEnabled?:
1711
1713
  boolean;
1714
+ /** Output only. Whether the customer accepted data use terms. */
1715
+ minimumDataTermAccepted?:
1716
+ boolean;
1712
1717
  /**
1713
1718
  * Immutable. The full resource name of the widget config. Format:
1714
1719
  * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}`. This field must be a UTF-8 encoded string with a
@@ -4946,9 +4951,189 @@ declare namespace gapi.client {
4946
4951
  string;
4947
4952
  }): Request<GoogleLongrunningListOperationsResponse>;
4948
4953
  }
4954
+ interface ServingConfigsResource {
4955
+ /** Makes a recommendation, which requires a contextual user event. */
4956
+ recommend(request: {
4957
+ /** V1 error format. */
4958
+ "$.xgafv"?:
4959
+ string;
4960
+ /** OAuth access token. */
4961
+ access_token?:
4962
+ string;
4963
+ /** Data format for response. */
4964
+ alt?:
4965
+ string;
4966
+ /** JSONP */
4967
+ callback?:
4968
+ string;
4969
+ /** Selector specifying which fields to include in a partial response. */
4970
+ fields?:
4971
+ string;
4972
+ /** 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. */
4973
+ key?:
4974
+ string;
4975
+ /** OAuth 2.0 token for the current user. */
4976
+ oauth_token?:
4977
+ string;
4978
+ /** Returns response with indentations and line breaks. */
4979
+ prettyPrint?:
4980
+ boolean;
4981
+ /** 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. */
4982
+ quotaUser?:
4983
+ string;
4984
+ /**
4985
+ * Required. Full resource name of the format: `projects/*‍/locations/global/collections/*‍/dataStores/*‍/servingConfigs/*` Before you can request recommendations from your model,
4986
+ * you must create at least one serving config for it.
4987
+ */
4988
+ servingConfig:
4989
+ string;
4990
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
4991
+ upload_protocol?:
4992
+ string;
4993
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
4994
+ uploadType?:
4995
+ string;
4996
+ /** Request body */
4997
+ resource:
4998
+ GoogleCloudDiscoveryengineV1alphaRecommendRequest;
4999
+ }): Request<GoogleCloudDiscoveryengineV1alphaRecommendResponse>;
5000
+ recommend(request: {
5001
+ /** V1 error format. */
5002
+ "$.xgafv"?:
5003
+ string;
5004
+ /** OAuth access token. */
5005
+ access_token?:
5006
+ string;
5007
+ /** Data format for response. */
5008
+ alt?:
5009
+ string;
5010
+ /** JSONP */
5011
+ callback?:
5012
+ string;
5013
+ /** Selector specifying which fields to include in a partial response. */
5014
+ fields?:
5015
+ string;
5016
+ /** 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. */
5017
+ key?:
5018
+ string;
5019
+ /** OAuth 2.0 token for the current user. */
5020
+ oauth_token?:
5021
+ string;
5022
+ /** Returns response with indentations and line breaks. */
5023
+ prettyPrint?:
5024
+ boolean;
5025
+ /** 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. */
5026
+ quotaUser?:
5027
+ string;
5028
+ /**
5029
+ * Required. Full resource name of the format: `projects/*‍/locations/global/collections/*‍/dataStores/*‍/servingConfigs/*` Before you can request recommendations from your model,
5030
+ * you must create at least one serving config for it.
5031
+ */
5032
+ servingConfig:
5033
+ string;
5034
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
5035
+ upload_protocol?:
5036
+ string;
5037
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
5038
+ uploadType?:
5039
+ string;
5040
+ },
5041
+ body: GoogleCloudDiscoveryengineV1alphaRecommendRequest): Request<GoogleCloudDiscoveryengineV1alphaRecommendResponse>;
5042
+ /** Performs a search. */
5043
+ search(request: {
5044
+ /** V1 error format. */
5045
+ "$.xgafv"?:
5046
+ string;
5047
+ /** OAuth access token. */
5048
+ access_token?:
5049
+ string;
5050
+ /** Data format for response. */
5051
+ alt?:
5052
+ string;
5053
+ /** JSONP */
5054
+ callback?:
5055
+ string;
5056
+ /** Selector specifying which fields to include in a partial response. */
5057
+ fields?:
5058
+ string;
5059
+ /** 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. */
5060
+ key?:
5061
+ string;
5062
+ /** OAuth 2.0 token for the current user. */
5063
+ oauth_token?:
5064
+ string;
5065
+ /** Returns response with indentations and line breaks. */
5066
+ prettyPrint?:
5067
+ boolean;
5068
+ /** 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. */
5069
+ quotaUser?:
5070
+ string;
5071
+ /**
5072
+ * Required. The resource name of the Search serving config, such as
5073
+ * `projects/*‍/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving
5074
+ * configuration name, set of models used to make the search.
5075
+ */
5076
+ servingConfig:
5077
+ string;
5078
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
5079
+ upload_protocol?:
5080
+ string;
5081
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
5082
+ uploadType?:
5083
+ string;
5084
+ /** Request body */
5085
+ resource:
5086
+ GoogleCloudDiscoveryengineV1alphaSearchRequest;
5087
+ }): Request<GoogleCloudDiscoveryengineV1alphaSearchResponse>;
5088
+ search(request: {
5089
+ /** V1 error format. */
5090
+ "$.xgafv"?:
5091
+ string;
5092
+ /** OAuth access token. */
5093
+ access_token?:
5094
+ string;
5095
+ /** Data format for response. */
5096
+ alt?:
5097
+ string;
5098
+ /** JSONP */
5099
+ callback?:
5100
+ string;
5101
+ /** Selector specifying which fields to include in a partial response. */
5102
+ fields?:
5103
+ string;
5104
+ /** 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. */
5105
+ key?:
5106
+ string;
5107
+ /** OAuth 2.0 token for the current user. */
5108
+ oauth_token?:
5109
+ string;
5110
+ /** Returns response with indentations and line breaks. */
5111
+ prettyPrint?:
5112
+ boolean;
5113
+ /** 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. */
5114
+ quotaUser?:
5115
+ string;
5116
+ /**
5117
+ * Required. The resource name of the Search serving config, such as
5118
+ * `projects/*‍/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving
5119
+ * configuration name, set of models used to make the search.
5120
+ */
5121
+ servingConfig:
5122
+ string;
5123
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
5124
+ upload_protocol?:
5125
+ string;
5126
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
5127
+ uploadType?:
5128
+ string;
5129
+ },
5130
+ body: GoogleCloudDiscoveryengineV1alphaSearchRequest): Request<GoogleCloudDiscoveryengineV1alphaSearchResponse>;
5131
+ }
4949
5132
  interface EnginesResource {
4950
5133
  operations:
4951
5134
  OperationsResource;
5135
+ servingConfigs:
5136
+ ServingConfigsResource;
4952
5137
  }
4953
5138
  interface OperationsResource {
4954
5139
  /** 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-v1alpha",
3
- "version": "0.0.20230928",
3
+ "version": "0.0.20231016",
4
4
  "description": "TypeScript typings for Discovery Engine API v1alpha",
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 */
@@ -1105,6 +1105,198 @@ gapi.load('client', async () => {
1105
1105
  pageSize: 42,
1106
1106
  pageToken: "Test string",
1107
1107
  });
1108
+ /** Makes a recommendation, which requires a contextual user event. */
1109
+ await gapi.client.discoveryengine.projects.locations.collections.engines.servingConfigs.recommend({
1110
+ servingConfig: "Test string",
1111
+ }, {
1112
+ filter: "Test string",
1113
+ pageSize: 42,
1114
+ params: {
1115
+ A: 42
1116
+ },
1117
+ userEvent: {
1118
+ attributes: {
1119
+ A: {
1120
+ numbers: [
1121
+ 42
1122
+ ],
1123
+ text: [
1124
+ "Test string"
1125
+ ],
1126
+ }
1127
+ },
1128
+ attributionToken: "Test string",
1129
+ completionInfo: {
1130
+ selectedPosition: 42,
1131
+ selectedSuggestion: "Test string",
1132
+ },
1133
+ directUserRequest: true,
1134
+ documents: [
1135
+ {
1136
+ id: "Test string",
1137
+ name: "Test string",
1138
+ promotionIds: [
1139
+ "Test string"
1140
+ ],
1141
+ quantity: 42,
1142
+ uri: "Test string",
1143
+ }
1144
+ ],
1145
+ eventTime: "Test string",
1146
+ eventType: "Test string",
1147
+ filter: "Test string",
1148
+ mediaInfo: {
1149
+ mediaProgressDuration: "Test string",
1150
+ mediaProgressPercentage: 42,
1151
+ },
1152
+ pageInfo: {
1153
+ pageCategory: "Test string",
1154
+ pageviewId: "Test string",
1155
+ referrerUri: "Test string",
1156
+ uri: "Test string",
1157
+ },
1158
+ panel: {
1159
+ displayName: "Test string",
1160
+ panelId: "Test string",
1161
+ panelPosition: 42,
1162
+ totalPanels: 42,
1163
+ },
1164
+ promotionIds: [
1165
+ "Test string"
1166
+ ],
1167
+ searchInfo: {
1168
+ offset: 42,
1169
+ orderBy: "Test string",
1170
+ searchQuery: "Test string",
1171
+ },
1172
+ sessionId: "Test string",
1173
+ tagIds: [
1174
+ "Test string"
1175
+ ],
1176
+ transactionInfo: {
1177
+ cost: 42,
1178
+ currency: "Test string",
1179
+ discountValue: 42,
1180
+ tax: 42,
1181
+ transactionId: "Test string",
1182
+ value: 42,
1183
+ },
1184
+ userInfo: {
1185
+ userAgent: "Test string",
1186
+ userId: "Test string",
1187
+ },
1188
+ userPseudoId: "Test string",
1189
+ },
1190
+ userLabels: {
1191
+ A: "Test string"
1192
+ },
1193
+ validateOnly: true,
1194
+ });
1195
+ /** Performs a search. */
1196
+ await gapi.client.discoveryengine.projects.locations.collections.engines.servingConfigs.search({
1197
+ servingConfig: "Test string",
1198
+ }, {
1199
+ boostSpec: {
1200
+ conditionBoostSpecs: [
1201
+ {
1202
+ boost: 42,
1203
+ condition: "Test string",
1204
+ }
1205
+ ],
1206
+ },
1207
+ branch: "Test string",
1208
+ contentSearchSpec: {
1209
+ extractiveContentSpec: {
1210
+ maxExtractiveAnswerCount: 42,
1211
+ maxExtractiveSegmentCount: 42,
1212
+ numNextSegments: 42,
1213
+ numPreviousSegments: 42,
1214
+ },
1215
+ snippetSpec: {
1216
+ maxSnippetCount: 42,
1217
+ referenceOnly: true,
1218
+ returnSnippet: true,
1219
+ },
1220
+ summarySpec: {
1221
+ ignoreAdversarialQuery: true,
1222
+ ignoreNonSummarySeekingQuery: true,
1223
+ includeCitations: true,
1224
+ languageCode: "Test string",
1225
+ summaryResultCount: 42,
1226
+ },
1227
+ },
1228
+ embeddingSpec: {
1229
+ embeddingVectors: [
1230
+ {
1231
+ fieldPath: "Test string",
1232
+ vector: [
1233
+ 42
1234
+ ],
1235
+ }
1236
+ ],
1237
+ },
1238
+ facetSpecs: [
1239
+ {
1240
+ enableDynamicPosition: true,
1241
+ excludedFilterKeys: [
1242
+ "Test string"
1243
+ ],
1244
+ facetKey: {
1245
+ caseInsensitive: true,
1246
+ contains: [
1247
+ "Test string"
1248
+ ],
1249
+ intervals: [
1250
+ {
1251
+ exclusiveMaximum: 42,
1252
+ exclusiveMinimum: 42,
1253
+ maximum: 42,
1254
+ minimum: 42,
1255
+ }
1256
+ ],
1257
+ key: "Test string",
1258
+ orderBy: "Test string",
1259
+ prefixes: [
1260
+ "Test string"
1261
+ ],
1262
+ restrictedValues: [
1263
+ "Test string"
1264
+ ],
1265
+ },
1266
+ limit: 42,
1267
+ }
1268
+ ],
1269
+ filter: "Test string",
1270
+ imageQuery: {
1271
+ imageBytes: "Test string",
1272
+ },
1273
+ offset: 42,
1274
+ orderBy: "Test string",
1275
+ pageSize: 42,
1276
+ pageToken: "Test string",
1277
+ params: {
1278
+ A: 42
1279
+ },
1280
+ query: "Test string",
1281
+ queryExpansionSpec: {
1282
+ condition: "Test string",
1283
+ pinUnexpandedResults: true,
1284
+ },
1285
+ rankingExpression: "Test string",
1286
+ safeSearch: true,
1287
+ servingConfig: "Test string",
1288
+ spellCorrectionSpec: {
1289
+ mode: "Test string",
1290
+ },
1291
+ userInfo: {
1292
+ userAgent: "Test string",
1293
+ userId: "Test string",
1294
+ },
1295
+ userLabels: {
1296
+ A: "Test string"
1297
+ },
1298
+ userPseudoId: "Test string",
1299
+ });
1108
1300
  /** 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. */
1109
1301
  await gapi.client.discoveryengine.projects.locations.collections.operations.get({
1110
1302
  name: "Test string",