@google-cloud/discoveryengine 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +39 -0
  3. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +190 -0
  4. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +134 -0
  5. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +138 -0
  6. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +306 -0
  7. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store.proto +98 -0
  8. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto +307 -0
  9. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +121 -0
  10. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +318 -0
  11. package/build/protos/google/cloud/discoveryengine/v1alpha/engine.proto +370 -0
  12. package/build/protos/google/cloud/discoveryengine/v1alpha/engine_service.proto +336 -0
  13. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +343 -0
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +159 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +227 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +312 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/schema_service.proto +260 -0
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +874 -0
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +152 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +475 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +154 -0
  22. package/build/protos/protos.d.ts +16365 -7
  23. package/build/protos/protos.js +42499 -1945
  24. package/build/protos/protos.json +4455 -5
  25. package/build/src/index.d.ts +3 -1
  26. package/build/src/index.js +4 -1
  27. package/build/src/v1alpha/completion_service_client.d.ts +645 -0
  28. package/build/src/v1alpha/completion_service_client.js +901 -0
  29. package/build/src/v1alpha/completion_service_client_config.json +43 -0
  30. package/build/src/v1alpha/conversational_search_service_client.d.ts +1040 -0
  31. package/build/src/v1alpha/conversational_search_service_client.js +1333 -0
  32. package/build/src/v1alpha/conversational_search_service_client_config.json +68 -0
  33. package/build/src/v1alpha/data_store_service_client.d.ts +1060 -0
  34. package/build/src/v1alpha/data_store_service_client.js +1431 -0
  35. package/build/src/v1alpha/data_store_service_client_config.json +46 -0
  36. package/build/src/v1alpha/document_service_client.d.ts +1257 -0
  37. package/build/src/v1alpha/document_service_client.js +1555 -0
  38. package/build/src/v1alpha/document_service_client_config.json +82 -0
  39. package/build/src/v1alpha/engine_service_client.d.ts +1079 -0
  40. package/build/src/v1alpha/engine_service_client.js +1481 -0
  41. package/build/src/v1alpha/engine_service_client_config.json +58 -0
  42. package/build/src/v1alpha/index.d.ts +10 -0
  43. package/build/src/v1alpha/index.js +41 -0
  44. package/build/src/v1alpha/recommendation_service_client.d.ts +858 -0
  45. package/build/src/v1alpha/recommendation_service_client.js +1100 -0
  46. package/build/src/v1alpha/recommendation_service_client_config.json +43 -0
  47. package/build/src/v1alpha/schema_service_client.d.ts +977 -0
  48. package/build/src/v1alpha/schema_service_client.js +1385 -0
  49. package/build/src/v1alpha/schema_service_client_config.json +63 -0
  50. package/build/src/v1alpha/search_service_client.d.ts +1394 -0
  51. package/build/src/v1alpha/search_service_client.js +1640 -0
  52. package/build/src/v1alpha/search_service_client_config.json +43 -0
  53. package/build/src/v1alpha/site_search_engine_service_client.d.ts +821 -0
  54. package/build/src/v1alpha/site_search_engine_service_client.js +1249 -0
  55. package/build/src/v1alpha/site_search_engine_service_client_config.json +30 -0
  56. package/build/src/v1alpha/user_event_service_client.d.ts +895 -0
  57. package/build/src/v1alpha/user_event_service_client.js +1232 -0
  58. package/build/src/v1alpha/user_event_service_client_config.json +67 -0
  59. package/package.json +5 -5
@@ -0,0 +1,159 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1alpha;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+
23
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
24
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "PurgeConfigProto";
27
+ option java_package = "com.google.cloud.discoveryengine.v1alpha";
28
+ option objc_class_prefix = "DISCOVERYENGINE";
29
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
30
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
31
+
32
+ // Request message for PurgeUserEvents method.
33
+ message PurgeUserEventsRequest {
34
+ // Required. The resource name of the catalog under which the events are
35
+ // created. The format is
36
+ // `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
37
+ string parent = 1 [
38
+ (google.api.field_behavior) = REQUIRED,
39
+ (google.api.resource_reference) = {
40
+ type: "discoveryengine.googleapis.com/DataStore"
41
+ }
42
+ ];
43
+
44
+ // Required. The filter string to specify the events to be deleted with a
45
+ // length limit of 5,000 characters. The eligible fields for filtering are:
46
+ //
47
+ // * `eventType`: Double quoted
48
+ // [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
49
+ // string.
50
+ // * `eventTime`: in ISO 8601 "zulu" format.
51
+ // * `userPseudoId`: Double quoted string. Specifying this will delete all
52
+ // events associated with a visitor.
53
+ // * `userId`: Double quoted string. Specifying this will delete all events
54
+ // associated with a user.
55
+ //
56
+ // Examples:
57
+ //
58
+ // * Deleting all events in a time range:
59
+ // `eventTime > "2012-04-23T18:25:43.511Z"
60
+ // eventTime < "2012-04-23T18:30:43.511Z"`
61
+ // * Deleting specific eventType:
62
+ // `eventType = "search"`
63
+ // * Deleting all events for a specific visitor:
64
+ // `userPseudoId = "visitor1024"`
65
+ // * Deleting all events inside a DataStore:
66
+ // `*`
67
+ //
68
+ // The filtering fields are assumed to have an implicit AND.
69
+ string filter = 2 [(google.api.field_behavior) = REQUIRED];
70
+
71
+ // The `force` field is currently not supported. Purge user event requests
72
+ // will permanently delete all purgeable events. Once the development is
73
+ // complete:
74
+ // If `force` is set to false, the method will return the expected
75
+ // purge count without deleting any user events. This field will default to
76
+ // false if not included in the request.
77
+ bool force = 3;
78
+ }
79
+
80
+ // Response of the PurgeUserEventsRequest. If the long running operation is
81
+ // successfully done, then this message is returned by the
82
+ // google.longrunning.Operations.response field.
83
+ message PurgeUserEventsResponse {
84
+ // The total count of events purged as a result of the operation.
85
+ int64 purge_count = 1;
86
+ }
87
+
88
+ // Metadata related to the progress of the PurgeUserEvents operation.
89
+ // This will be returned by the google.longrunning.Operation.metadata field.
90
+ message PurgeUserEventsMetadata {
91
+ // Operation create time.
92
+ google.protobuf.Timestamp create_time = 1;
93
+
94
+ // Operation last update time. If the operation is done, this is also the
95
+ // finish time.
96
+ google.protobuf.Timestamp update_time = 2;
97
+
98
+ // Count of entries that were deleted successfully.
99
+ int64 success_count = 3;
100
+
101
+ // Count of entries that encountered errors while processing.
102
+ int64 failure_count = 4;
103
+ }
104
+
105
+ // Request message for
106
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
107
+ // method.
108
+ message PurgeDocumentsRequest {
109
+ // Required. The parent resource name, such as
110
+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
111
+ string parent = 1 [
112
+ (google.api.field_behavior) = REQUIRED,
113
+ (google.api.resource_reference) = {
114
+ type: "discoveryengine.googleapis.com/Branch"
115
+ }
116
+ ];
117
+
118
+ // Required. Filter matching documents to purge. Only currently supported
119
+ // value is
120
+ // `*` (all items).
121
+ string filter = 2 [(google.api.field_behavior) = REQUIRED];
122
+
123
+ // Actually performs the purge. If `force` is set to false, return the
124
+ // expected purge count without deleting any documents.
125
+ bool force = 3;
126
+ }
127
+
128
+ // Response message for
129
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
130
+ // method. If the long running operation is successfully done, then this message
131
+ // is returned by the google.longrunning.Operations.response field.
132
+ message PurgeDocumentsResponse {
133
+ // The total count of documents purged as a result of the operation.
134
+ int64 purge_count = 1;
135
+
136
+ // A sample of document names that will be deleted. Only populated if `force`
137
+ // is set to false. A max of 100 names will be returned and the names are
138
+ // chosen at random.
139
+ repeated string purge_sample = 2 [(google.api.resource_reference) = {
140
+ type: "discoveryengine.googleapis.com/Document"
141
+ }];
142
+ }
143
+
144
+ // Metadata related to the progress of the PurgeDocuments operation.
145
+ // This will be returned by the google.longrunning.Operation.metadata field.
146
+ message PurgeDocumentsMetadata {
147
+ // Operation create time.
148
+ google.protobuf.Timestamp create_time = 1;
149
+
150
+ // Operation last update time. If the operation is done, this is also the
151
+ // finish time.
152
+ google.protobuf.Timestamp update_time = 2;
153
+
154
+ // Count of entries that were deleted successfully.
155
+ int64 success_count = 3;
156
+
157
+ // Count of entries that encountered errors while processing.
158
+ int64 failure_count = 4;
159
+ }
@@ -0,0 +1,227 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1alpha;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
23
+ import "google/cloud/discoveryengine/v1alpha/document.proto";
24
+ import "google/cloud/discoveryengine/v1alpha/user_event.proto";
25
+ import "google/protobuf/struct.proto";
26
+
27
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
28
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "RecommendationServiceProto";
31
+ option java_package = "com.google.cloud.discoveryengine.v1alpha";
32
+ option objc_class_prefix = "DISCOVERYENGINE";
33
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
34
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
35
+
36
+ // Service for making recommendations.
37
+ service RecommendationService {
38
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
39
+ option (google.api.oauth_scopes) =
40
+ "https://www.googleapis.com/auth/cloud-platform";
41
+
42
+ // Makes a recommendation, which requires a contextual user event.
43
+ rpc Recommend(RecommendRequest) returns (RecommendResponse) {
44
+ option (google.api.http) = {
45
+ post: "/v1alpha/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend"
46
+ body: "*"
47
+ additional_bindings {
48
+ post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:recommend"
49
+ body: "*"
50
+ }
51
+ additional_bindings {
52
+ post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:recommend"
53
+ body: "*"
54
+ }
55
+ };
56
+ }
57
+ }
58
+
59
+ // Request message for Recommend method.
60
+ message RecommendRequest {
61
+ // Required. Full resource name of a
62
+ // [ServingConfig][google.cloud.discoveryengine.v1alpha.ServingConfig]:
63
+ // `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or
64
+ // `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
65
+ //
66
+ // One default serving config is created along with your recommendation engine
67
+ // creation. The engine ID will be used as the ID of the default serving
68
+ // config. For example, for Engine
69
+ // `projects/*/locations/global/collections/*/engines/my-engine`, you can use
70
+ // `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine`
71
+ // for your [Recommend][] requests.
72
+ string serving_config = 1 [
73
+ (google.api.field_behavior) = REQUIRED,
74
+ (google.api.resource_reference) = {
75
+ type: "discoveryengine.googleapis.com/ServingConfig"
76
+ }
77
+ ];
78
+
79
+ // Required. Context about the user, what they are looking at and what action
80
+ // they took to trigger the Recommend request. Note that this user event
81
+ // detail won't be ingested to userEvent logs. Thus, a separate userEvent
82
+ // write request is required for event logging.
83
+ //
84
+ // Don't set
85
+ // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
86
+ // or
87
+ // [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
88
+ // to the same fixed ID for different users. If you are trying to receive
89
+ // non-personalized recommendations (not recommended; this can negatively
90
+ // impact model performance), instead set
91
+ // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
92
+ // to a random unique ID and leave
93
+ // [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
94
+ // unset.
95
+ UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED];
96
+
97
+ // Maximum number of results to return. Set this property
98
+ // to the number of recommendation results needed. If zero, the service will
99
+ // choose a reasonable default. The maximum allowed value is 100. Values
100
+ // above 100 will be coerced to 100.
101
+ int32 page_size = 3;
102
+
103
+ // Filter for restricting recommendation results with a length limit of 5,000
104
+ // characters. Currently, only filter expressions on the `filter_tags`
105
+ // attribute is supported.
106
+ //
107
+ //
108
+ // Examples:
109
+ //
110
+ // * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
111
+ // * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
112
+ //
113
+ // If `attributeFilteringSyntax` is set to true under the `params` field, then
114
+ // attribute-based expressions are expected instead of the above described
115
+ // tag-based syntax. Examples:
116
+ //
117
+ // * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
118
+ // * (available: true) AND
119
+ // (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
120
+ //
121
+ // If your filter blocks all results, the API will return generic
122
+ // (unfiltered) popular Documents. If you only want results strictly matching
123
+ // the filters, set `strictFiltering` to True in
124
+ // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
125
+ // to receive empty results instead.
126
+ //
127
+ // Note that the API will never return
128
+ // [Document][google.cloud.discoveryengine.v1alpha.Document]s with
129
+ // `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
130
+ string filter = 4;
131
+
132
+ // Use validate only mode for this recommendation query. If set to true, a
133
+ // fake model will be used that returns arbitrary Document IDs.
134
+ // Note that the validate only mode should only be used for testing the API,
135
+ // or if the model is not ready.
136
+ bool validate_only = 5;
137
+
138
+ // Additional domain specific parameters for the recommendations.
139
+ //
140
+ // Allowed values:
141
+ //
142
+ // * `returnDocument`: Boolean. If set to true, the associated Document
143
+ // object will be returned in
144
+ // [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
145
+ // * `returnScore`: Boolean. If set to true, the recommendation 'score'
146
+ // corresponding to each returned Document will be set in
147
+ // [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
148
+ // The given 'score' indicates the probability of a Document conversion
149
+ // given the user's context and history.
150
+ // * `strictFiltering`: Boolean. True by default. If set to false, the service
151
+ // will return generic (unfiltered) popular Documents instead of empty if
152
+ // your filter blocks all recommendation results.
153
+ // * `diversityLevel`: String. Default empty. If set to be non-empty, then
154
+ // it needs to be one of:
155
+ // * `no-diversity`
156
+ // * `low-diversity`
157
+ // * `medium-diversity`
158
+ // * `high-diversity`
159
+ // * `auto-diversity`
160
+ // This gives request-level control and adjusts recommendation results
161
+ // based on Document category.
162
+ // * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
163
+ // the `filter` field is interpreted according to the new,
164
+ // attribute-based syntax.
165
+ map<string, google.protobuf.Value> params = 6;
166
+
167
+ // The user labels applied to a resource must meet the following requirements:
168
+ //
169
+ // * Each resource can have multiple labels, up to a maximum of 64.
170
+ // * Each label must be a key-value pair.
171
+ // * Keys have a minimum length of 1 character and a maximum length of 63
172
+ // characters and cannot be empty. Values can be empty and have a maximum
173
+ // length of 63 characters.
174
+ // * Keys and values can contain only lowercase letters, numeric characters,
175
+ // underscores, and dashes. All characters must use UTF-8 encoding, and
176
+ // international characters are allowed.
177
+ // * The key portion of a label must be unique. However, you can use the same
178
+ // key with multiple resources.
179
+ // * Keys must start with a lowercase letter or international character.
180
+ //
181
+ // See [Requirements for
182
+ // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
183
+ // for more details.
184
+ map<string, string> user_labels = 8;
185
+ }
186
+
187
+ // Response message for Recommend method.
188
+ message RecommendResponse {
189
+ // RecommendationResult represents a generic recommendation result with
190
+ // associated metadata.
191
+ message RecommendationResult {
192
+ // Resource ID of the recommended Document.
193
+ string id = 1;
194
+
195
+ // Set if `returnDocument` is set to true in
196
+ // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
197
+ Document document = 2;
198
+
199
+ // Additional Document metadata / annotations.
200
+ //
201
+ // Possible values:
202
+ //
203
+ // * `score`: Recommendation score in double value. Is set if
204
+ // `returnScore` is set to true in
205
+ // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
206
+ map<string, google.protobuf.Value> metadata = 3;
207
+ }
208
+
209
+ // A list of recommended Documents. The order represents the ranking (from the
210
+ // most relevant Document to the least).
211
+ repeated RecommendationResult results = 1;
212
+
213
+ // A unique attribution token. This should be included in the
214
+ // [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
215
+ // from this recommendation, which enables accurate attribution of
216
+ // recommendation model performance.
217
+ string attribution_token = 2;
218
+
219
+ // IDs of documents in the request that were missing from the default Branch
220
+ // associated with the requested ServingConfig.
221
+ repeated string missing_ids = 3;
222
+
223
+ // True if
224
+ // [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
225
+ // was set.
226
+ bool validate_only = 4;
227
+ }