@google-cloud/discoveryengine 0.8.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +13 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +7 -2
  15. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +13 -2
  16. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +138 -0
  17. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +306 -0
  18. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +2 -4
  19. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +2 -1
  20. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +17 -17
  21. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +1 -1
  22. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +276 -64
  23. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +45 -36
  24. package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +2 -2
  25. package/build/protos/protos.d.ts +13913 -8367
  26. package/build/protos/protos.js +36766 -22883
  27. package/build/protos/protos.json +3956 -2571
  28. package/build/src/index.d.ts +4 -1
  29. package/build/src/index.js +4 -1
  30. package/build/src/v1/completion_service_client.d.ts +161 -12
  31. package/build/src/v1/completion_service_client.js +188 -4
  32. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  33. package/build/src/v1/conversational_search_service_client.js +1205 -0
  34. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  35. package/build/src/v1/document_service_client.d.ts +245 -109
  36. package/build/src/v1/document_service_client.js +231 -31
  37. package/build/src/v1/index.d.ts +1 -0
  38. package/build/src/v1/index.js +3 -1
  39. package/build/src/v1/schema_service_client.d.ts +187 -53
  40. package/build/src/v1/schema_service_client.js +224 -27
  41. package/build/src/v1/search_service_client.d.ts +266 -59
  42. package/build/src/v1/search_service_client.js +267 -41
  43. package/build/src/v1/user_event_service_client.d.ts +159 -19
  44. package/build/src/v1/user_event_service_client.js +208 -7
  45. package/build/src/v1beta/completion_service_client.d.ts +159 -12
  46. package/build/src/v1beta/completion_service_client.js +188 -4
  47. package/build/src/v1beta/conversational_search_service_client.d.ts +947 -0
  48. package/build/src/v1beta/conversational_search_service_client.js +1205 -0
  49. package/build/src/v1beta/conversational_search_service_client_config.json +68 -0
  50. package/build/src/v1beta/document_service_client.d.ts +237 -101
  51. package/build/src/v1beta/document_service_client.js +227 -27
  52. package/build/src/v1beta/index.d.ts +1 -0
  53. package/build/src/v1beta/index.js +3 -1
  54. package/build/src/v1beta/recommendation_service_client.d.ts +158 -15
  55. package/build/src/v1beta/recommendation_service_client.js +188 -4
  56. package/build/src/v1beta/schema_service_client.d.ts +187 -53
  57. package/build/src/v1beta/schema_service_client.js +224 -27
  58. package/build/src/v1beta/search_service_client.d.ts +305 -71
  59. package/build/src/v1beta/search_service_client.js +293 -49
  60. package/build/src/v1beta/user_event_service_client.d.ts +156 -16
  61. package/build/src/v1beta/user_event_service_client.js +208 -7
  62. package/package.json +10 -13
@@ -66,7 +66,7 @@ message UserEvent {
66
66
  // quality.
67
67
  //
68
68
  // The field must be a UTF-8 encoded string with a length limit of 128
69
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
69
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
70
70
  //
71
71
  // The field should not contain PII or user-data. We recommend to use Google
72
72
  // Analytics [Client
@@ -119,20 +119,17 @@ message UserEvent {
119
119
  //
120
120
  // The value must be one of:
121
121
  //
122
- // * [PredictResponse.attribution_token][] for events that are the result of
122
+ // * [RecommendResponse.attribution_token][] for events that are the result of
123
123
  // [RecommendationService.Recommend][].
124
124
  // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of
125
125
  // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search].
126
- // * [CompleteQueryResponse.attribution_token][] for events that are the
127
- // result of
128
- // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery].
129
126
  //
130
127
  // This token enables us to accurately attribute page view or conversion
131
128
  // completion back to the event and the particular predict response containing
132
129
  // this clicked/purchased product. If user clicks on product K in the
133
- // recommendation results, pass [PredictResponse.attribution_token][] as a URL
134
- // parameter to product K's page. When recording events on product K's page,
135
- // log the [PredictResponse.attribution_token][] to this field.
130
+ // recommendation results, pass [RecommendResponse.attribution_token][] as a
131
+ // URL parameter to product K's page. When recording events on product K's
132
+ // page, log the [RecommendResponse.attribution_token][] to this field.
136
133
  string attribution_token = 8;
137
134
 
138
135
  // The filter syntax consists of an expression language for constructing a
@@ -140,8 +137,9 @@ message UserEvent {
140
137
  //
141
138
  // One example is for `search` events, the associated
142
139
  // [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain
143
- // a filter expression in [SearchRequest.filter][] conforming to
144
- // https://google.aip.dev/160#filtering.
140
+ // a filter expression in
141
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
142
+ // conforming to https://google.aip.dev/160#filtering.
145
143
  //
146
144
  // Similarly, for `view-item-list` events that are generated from a
147
145
  // [RecommendationService.RecommendRequest][], this field may be populated
@@ -149,10 +147,11 @@ message UserEvent {
149
147
  // to https://google.aip.dev/160#filtering.
150
148
  //
151
149
  // The value must be a UTF-8 encoded string with a length limit of 1,000
152
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
150
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
153
151
  string filter = 9;
154
152
 
155
- // List of Documents associated with this user event.
153
+ // List of [Document][google.cloud.discoveryengine.v1.Document]s associated
154
+ // with this user event.
156
155
  //
157
156
  // This field is optional except for the following event types:
158
157
  //
@@ -174,12 +173,14 @@ message UserEvent {
174
173
  // Panel metadata associated with this user event.
175
174
  PanelInfo panel = 11;
176
175
 
177
- // Search API details related to the event.
176
+ // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
177
+ // details related to the event.
178
178
  //
179
179
  // This field should be set for `search` event.
180
180
  SearchInfo search_info = 12;
181
181
 
182
- // CompleteQuery API details related to the event.
182
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
183
+ // details related to the event.
183
184
  //
184
185
  // This field should be set for `search` event when autocomplete function is
185
186
  // enabled and the user clicks a suggestion for search.
@@ -219,7 +220,7 @@ message UserEvent {
219
220
  // * For number attributes, at most 400 values are allowed.
220
221
  //
221
222
  // For product recommendations, an example of extra user information is
222
- // ` traffic_channel`, which is how a user arrives at the site. Users can
223
+ // `traffic_channel`, which is how a user arrives at the site. Users can
223
224
  // arrive
224
225
  // at the site by coming to the site directly, coming through Google
225
226
  // search, or in other ways.
@@ -235,7 +236,7 @@ message PageInfo {
235
236
  //
236
237
  // This should be kept the same for all user events triggered from the same
237
238
  // pageview. For example, an item detail page view could trigger multiple
238
- // events as the user is browsing the page. The `pageViewId` property should
239
+ // events as the user is browsing the page. The `pageview_id` property should
239
240
  // be kept the same for all these events so that they can be grouped together
240
241
  // properly.
241
242
  //
@@ -251,10 +252,10 @@ message PageInfo {
251
252
  //
252
253
  // Category pages include special pages such as sales or promotions. For
253
254
  // instance, a special sale page may have the category hierarchy:
254
- // "pageCategory" : "Sales > 2017 Black Friday Deals".
255
+ // `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
255
256
  //
256
257
  // Required for `view-category-page` events. Other event types should not set
257
- // this field. Otherwise, an INVALID_ARGUMENT error is returned.
258
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
258
259
  string page_category = 2;
259
260
 
260
261
  // Complete URL (window.location.href) of the user's current page.
@@ -281,24 +282,26 @@ message SearchInfo {
281
282
  // for definition.
282
283
  //
283
284
  // The value must be a UTF-8 encoded string with a length limit of 5,000
284
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
285
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
285
286
  //
286
287
  // At least one of
287
288
  // [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or
288
289
  // [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category]
289
290
  // is required for `search` events. Other event types should not set this
290
- // field. Otherwise, an INVALID_ARGUMENT error is returned.
291
+ // field. Otherwise, an `INVALID_ARGUMENT` error is returned.
291
292
  string search_query = 1;
292
293
 
293
294
  // The order in which products are returned, if applicable.
294
295
  //
295
- // See [SearchRequest.order_by][] for definition and syntax.
296
+ // See
297
+ // [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
298
+ // for definition and syntax.
296
299
  //
297
300
  // The value must be a UTF-8 encoded string with a length limit of 1,000
298
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
301
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
299
302
  //
300
303
  // This can only be set for `search` events. Other event types should not set
301
- // this field. Otherwise, an INVALID_ARGUMENT error is returned.
304
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
302
305
  string order_by = 2;
303
306
 
304
307
  // An integer that specifies the current offset for pagination (the 0-indexed
@@ -308,20 +311,22 @@ message SearchInfo {
308
311
  // [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset]
309
312
  // for definition.
310
313
  //
311
- // If this field is negative, an INVALID_ARGUMENT is returned.
314
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
312
315
  //
313
316
  // This can only be set for `search` events. Other event types should not set
314
- // this field. Otherwise, an INVALID_ARGUMENT error is returned.
317
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
315
318
  optional int32 offset = 3;
316
319
  }
317
320
 
318
321
  // Detailed completion information including completion attribution token and
319
322
  // clicked completion info.
320
323
  message CompletionInfo {
321
- // End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
324
+ // End user selected
325
+ // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
322
326
  string selected_suggestion = 1;
323
327
 
324
- // End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
328
+ // End user selected
329
+ // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
325
330
  // position, starting from 0.
326
331
  int32 selected_position = 2;
327
332
  }
@@ -389,17 +394,19 @@ message DocumentInfo {
389
394
  // `{location}`, `{collection_id}`, `{data_store_id}`, and
390
395
  // `{branch_id}` are used when annotating with the stored Document.
391
396
  oneof document_descriptor {
392
- // Required. The Document resource ID.
393
- string id = 1 [(google.api.field_behavior) = REQUIRED];
397
+ // The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
398
+ string id = 1;
394
399
 
395
- // Required. The Document resource full name, of the form:
400
+ // The [Document][google.cloud.discoveryengine.v1.Document] resource full
401
+ // name, of the form:
396
402
  // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
397
- string name = 2 [
398
- (google.api.field_behavior) = REQUIRED,
399
- (google.api.resource_reference) = {
400
- type: "discoveryengine.googleapis.com/Document"
401
- }
402
- ];
403
+ string name = 2 [(google.api.resource_reference) = {
404
+ type: "discoveryengine.googleapis.com/Document"
405
+ }];
406
+
407
+ // The [Document][google.cloud.discoveryengine.v1.Document] URI - only
408
+ // allowed for website data stores.
409
+ string uri = 6;
403
410
  }
404
411
 
405
412
  // Quantity of the Document associated with the user event. Defaults to 1.
@@ -443,11 +450,13 @@ message PanelInfo {
443
450
  message MediaInfo {
444
451
  // The media progress time in seconds, if applicable.
445
452
  // For example, if the end user has finished 90 seconds of a playback video,
446
- // then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
447
- // be set to 90.
453
+ // then
454
+ // [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
455
+ // should be set to 90.
448
456
  google.protobuf.Duration media_progress_duration = 1;
449
457
 
450
- // Media progress should be computed using only the media_progress_duration
458
+ // Media progress should be computed using only the
459
+ // [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
451
460
  // relative to the media total length.
452
461
  //
453
462
  // This value must be between `[0, 1.0]` inclusive.
@@ -53,7 +53,7 @@ service UserEventService {
53
53
  }
54
54
 
55
55
  // Writes a single user event from the browser. This uses a GET request to
56
- // due to browser restriction of POST-ing to a 3rd party domain.
56
+ // due to browser restriction of POST-ing to a third-party domain.
57
57
  //
58
58
  // This method is used only by the Discovery Engine API JavaScript pixel and
59
59
  // Google Tag Manager. Users should not call this method directly.
@@ -122,7 +122,7 @@ message CollectUserEventRequest {
122
122
 
123
123
  // The URL including cgi-parameters but excluding the hash fragment with a
124
124
  // length limit of 5,000 characters. This is often more useful than the
125
- // referer URL, because many browsers only send the domain for 3rd party
125
+ // referer URL, because many browsers only send the domain for third-party
126
126
  // requests.
127
127
  optional string uri = 3;
128
128
 
@@ -113,8 +113,7 @@ message UserInfo {
113
113
  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
114
114
  string user_id = 1;
115
115
 
116
- // User agent as included in the HTTP header. Required for getting
117
- // [SearchResponse.sponsored_results][].
116
+ // User agent as included in the HTTP header.
118
117
  //
119
118
  // The field must be a UTF-8 encoded string with a length limit of 1,000
120
119
  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -127,3 +126,9 @@ message UserInfo {
127
126
  // is set.
128
127
  string user_agent = 2;
129
128
  }
129
+
130
+ // Double list.
131
+ message DoubleList {
132
+ // Double values.
133
+ repeated double values = 1;
134
+ }
@@ -81,8 +81,7 @@ message CompleteQueryRequest {
81
81
  //
82
82
  // * `document` is the default model for regular dataStores.
83
83
  // * `search-history` is the default model for
84
- // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
85
- // dataStores.
84
+ // [IndustryVertical.SITE_SEARCH][] dataStores.
86
85
  string query_model = 3;
87
86
 
88
87
  // A unique identifier for tracking visitors. For example, this could be
@@ -100,6 +99,12 @@ message CompleteQueryRequest {
100
99
  // The field must be a UTF-8 encoded string with a length limit of 128
101
100
  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
102
101
  string user_pseudo_id = 4;
102
+
103
+ // Indicates if tail suggestions should be returned if there are no
104
+ // suggestions that match the full query. Even if set to true, if there are
105
+ // suggestions that match the full query, those are returned and no
106
+ // tail suggestions are returned.
107
+ bool include_tail_suggestions = 5;
103
108
  }
104
109
 
105
110
  // Response message for
@@ -115,4 +120,10 @@ message CompleteQueryResponse {
115
120
  // Results of the matched query suggestions. The result list is ordered and
116
121
  // the first result is a top suggestion.
117
122
  repeated QuerySuggestion query_suggestions = 1;
123
+
124
+ // True if the returned suggestions are all tail suggestions.
125
+ //
126
+ // For tail matching to be triggered, include_tail_suggestions in the request
127
+ // must be true and there must be no suggestions that match the full query.
128
+ bool tail_match_triggered = 2;
118
129
  }
@@ -0,0 +1,138 @@
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.v1beta;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/cloud/discoveryengine/v1beta/search_service.proto";
22
+ import "google/protobuf/timestamp.proto";
23
+
24
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
25
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
26
+ option java_multiple_files = true;
27
+ option java_outer_classname = "ConversationProto";
28
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
29
+ option objc_class_prefix = "DISCOVERYENGINE";
30
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
31
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
32
+
33
+ // External conversation proto definition.
34
+ message Conversation {
35
+ option (google.api.resource) = {
36
+ type: "discoveryengine.googleapis.com/Conversation"
37
+ pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"
38
+ pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"
39
+ };
40
+
41
+ // Enumeration of the state of the conversation.
42
+ enum State {
43
+ // Unknown.
44
+ STATE_UNSPECIFIED = 0;
45
+
46
+ // Conversation is currently open.
47
+ IN_PROGRESS = 1;
48
+
49
+ // Conversation has been completed.
50
+ COMPLETED = 2;
51
+ }
52
+
53
+ // Immutable. Fully qualified name
54
+ // `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
55
+ string name = 1 [(google.api.field_behavior) = IMMUTABLE];
56
+
57
+ // The state of the Conversation.
58
+ State state = 2;
59
+
60
+ // A unique identifier for tracking users.
61
+ string user_pseudo_id = 3;
62
+
63
+ // Conversation messages.
64
+ repeated ConversationMessage messages = 4;
65
+
66
+ // Output only. The time the conversation started.
67
+ google.protobuf.Timestamp start_time = 5
68
+ [(google.api.field_behavior) = OUTPUT_ONLY];
69
+
70
+ // Output only. The time the conversation finished.
71
+ google.protobuf.Timestamp end_time = 6
72
+ [(google.api.field_behavior) = OUTPUT_ONLY];
73
+ }
74
+
75
+ // Defines a reply message to user.
76
+ message Reply {
77
+ // Defines reference in reply.
78
+ message Reference {
79
+ option deprecated = true;
80
+
81
+ // URI link reference.
82
+ string uri = 1;
83
+
84
+ // Anchor text.
85
+ string anchor_text = 2;
86
+
87
+ // Anchor text start index.
88
+ int32 start = 3;
89
+
90
+ // Anchor text end index.
91
+ int32 end = 4;
92
+ }
93
+
94
+ // DEPRECATED: use `summary` instead.
95
+ // Text reply.
96
+ string reply = 1 [deprecated = true];
97
+
98
+ // References in the reply.
99
+ repeated Reference references = 2 [deprecated = true];
100
+
101
+ // Summary based on search results.
102
+ SearchResponse.Summary summary = 3;
103
+ }
104
+
105
+ // Defines context of the conversation
106
+ message ConversationContext {
107
+ // The current list of documents the user is seeing.
108
+ // It contains the document resource references.
109
+ repeated string context_documents = 1;
110
+
111
+ // The current active document the user opened.
112
+ // It contains the document resource reference.
113
+ string active_document = 2;
114
+ }
115
+
116
+ // Defines text input.
117
+ message TextInput {
118
+ // Text input.
119
+ string input = 1;
120
+
121
+ // Conversation context of the input.
122
+ ConversationContext context = 2;
123
+ }
124
+
125
+ // Defines a conversation message.
126
+ message ConversationMessage {
127
+ oneof message {
128
+ // User text input.
129
+ TextInput user_input = 1;
130
+
131
+ // Search reply.
132
+ Reply reply = 2;
133
+ }
134
+
135
+ // Output only. Message creation timestamp.
136
+ google.protobuf.Timestamp create_time = 3
137
+ [(google.api.field_behavior) = OUTPUT_ONLY];
138
+ }