@google-cloud/discoveryengine 0.6.0 → 0.8.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 (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +38 -22
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +100 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/document.proto +118 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +313 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +334 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +58 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/schema_service.proto +256 -0
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +289 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +458 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +133 -0
  14. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +2 -0
  15. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +4 -1
  16. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +65 -7
  17. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +75 -4
  18. package/build/protos/protos.d.ts +6704 -0
  19. package/build/protos/protos.js +16332 -5
  20. package/build/protos/protos.json +1830 -12
  21. package/build/src/index.d.ts +18 -19
  22. package/build/src/index.js +9 -9
  23. package/build/src/v1/completion_service_client.d.ts +455 -0
  24. package/build/src/v1/completion_service_client.js +659 -0
  25. package/build/src/v1/completion_service_client_config.json +43 -0
  26. package/build/src/v1/document_service_client.d.ts +995 -0
  27. package/build/src/v1/document_service_client.js +1191 -0
  28. package/build/src/v1/document_service_client_config.json +82 -0
  29. package/build/src/v1/index.d.ts +5 -0
  30. package/build/src/v1/index.js +31 -0
  31. package/build/src/v1/schema_service_client.d.ts +795 -0
  32. package/build/src/v1/schema_service_client.js +1129 -0
  33. package/build/src/v1/schema_service_client_config.json +63 -0
  34. package/build/src/v1/search_service_client.d.ts +857 -0
  35. package/build/src/v1/search_service_client.js +1073 -0
  36. package/build/src/v1/search_service_client_config.json +43 -0
  37. package/build/src/v1/user_event_service_client.d.ts +638 -0
  38. package/build/src/v1/user_event_service_client.js +933 -0
  39. package/build/src/v1/user_event_service_client_config.json +62 -0
  40. package/build/src/v1beta/completion_service_client.d.ts +2 -0
  41. package/build/src/v1beta/document_service_client.d.ts +52 -0
  42. package/build/src/v1beta/document_service_client.js +6 -0
  43. package/build/src/v1beta/schema_service_client.js +6 -0
  44. package/build/src/v1beta/search_service_client.d.ts +78 -12
  45. package/build/src/v1beta/search_service_client.js +52 -8
  46. package/build/src/v1beta/user_event_service_client.d.ts +3 -3
  47. package/build/src/v1beta/user_event_service_client.js +6 -0
  48. package/package.json +2 -2
@@ -60,6 +60,10 @@ message GcsSource {
60
60
  // * `custom`: One custom data JSON per row in arbitrary format that conforms
61
61
  // the defined [Schema][google.cloud.discoveryengine.v1beta.Schema] of the
62
62
  // data store. This can only be used by the GENERIC Data Store vertical.
63
+ // * `csv`: A CSV file with header conforming the defined
64
+ // [Schema][google.cloud.discoveryengine.v1beta.Schema] of the
65
+ // data store. Each entry after the header will be imported as a Document.
66
+ // This can only be used by the GENERIC Data Store vertical.
63
67
  //
64
68
  // Supported values for user even imports:
65
69
  //
@@ -137,16 +141,16 @@ message ImportUserEventsRequest {
137
141
  repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
138
142
  }
139
143
 
140
- // The desired input source of the user event data.
144
+ // Required - The desired input source of the user event data.
141
145
  oneof source {
142
- // Required. The Inline source for the input content for UserEvents.
143
- InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
146
+ // The Inline source for the input content for UserEvents.
147
+ InlineSource inline_source = 2;
144
148
 
145
- // Required. Cloud Storage location for the input content.
146
- GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
149
+ // Cloud Storage location for the input content.
150
+ GcsSource gcs_source = 3;
147
151
 
148
- // Required. BigQuery input source.
149
- BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
152
+ // BigQuery input source.
153
+ BigQuerySource bigquery_source = 4;
150
154
  }
151
155
 
152
156
  // Required. Parent DataStore resource name, of the form
@@ -269,6 +273,60 @@ message ImportDocumentsRequest {
269
273
  // be imported. Defaults to
270
274
  // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
271
275
  ReconciliationMode reconciliation_mode = 6;
276
+
277
+ // Whether to automatically generate IDs for the documents if absent.
278
+ //
279
+ // If set to `true`,
280
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
281
+ // automatically generated based on the hash of the payload, where IDs may not
282
+ // be consistent during multiple imports. In which case
283
+ // [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
284
+ // is highly recommended to avoid duplicate contents. If unset or set to
285
+ // `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
286
+ // have to be specified using
287
+ // [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
288
+ // otherwises, documents without IDs will fail to be imported.
289
+ //
290
+ // Only set this field when using
291
+ // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
292
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
293
+ // when
294
+ // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
295
+ // or
296
+ // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
297
+ // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
298
+ bool auto_generate_ids = 8;
299
+
300
+ // The field in the Cloud Storage and BigQuery sources that indicates the
301
+ // unique IDs of the documents.
302
+ //
303
+ // For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
304
+ // key of the JSON field. For instance, `my_id` for JSON `{"my_id":
305
+ // "some_uuid"}`. For
306
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource] it is
307
+ // the column name of the BigQuery table where the unique ids are stored.
308
+ //
309
+ // The values of the JSON field or the BigQuery column will be used as the
310
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. The JSON
311
+ // field or the BigQuery column must be of string type, and the values must be
312
+ // set as valid strings conform to
313
+ // [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
314
+ // Otherwise, documents without valid IDs will fail to be imported.
315
+ //
316
+ // Only set this field when using
317
+ // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
318
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
319
+ // when
320
+ // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
321
+ // or
322
+ // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
323
+ // is `custom`. And only set this field when
324
+ // [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids]
325
+ // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
326
+ //
327
+ // If it is unset, a default value `_id` is used when importing from the
328
+ // allowed data sources.
329
+ string id_field = 9;
272
330
  }
273
331
 
274
332
  // Response of the
@@ -287,6 +287,10 @@ message SearchRequest {
287
287
  // The specification that configs the snippet in the search results.
288
288
  message SnippetSpec {
289
289
  // Max number of snippets returned in each search result.
290
+ //
291
+ // A snippet is an infomartive summary of a content with highlighting for
292
+ // UI rendering.
293
+ //
290
294
  // If the matching snippets is less than the max_snippet_count, return all
291
295
  // of the snippets; otherwise, return the max_snippet_count.
292
296
  //
@@ -308,6 +312,36 @@ message SearchRequest {
308
312
  int32 summary_result_count = 1;
309
313
  }
310
314
 
315
+ // The specification that configs the extractive content in search results.
316
+ message ExtractiveContentSpec {
317
+ // The max number of extractive answers returned in each search result.
318
+ //
319
+ // An extractive answer is a verbatim answer extracted from the original
320
+ // document, which provides precise and contextually relevant answer to
321
+ // the search query.
322
+ //
323
+ // If the number of matching answers is less than the
324
+ // extractive_answer_count, return all of the answers; otherwise, return
325
+ // the extractive_answer_count.
326
+ //
327
+ // At most 5 answers will be returned for each SearchResult.
328
+ int32 max_extractive_answer_count = 1;
329
+
330
+ // The max number of extractive segments returned in each search result.
331
+ //
332
+ // An extractive segment is a text segment extracted from the original
333
+ // document which is relevant to the search query and in general more
334
+ // verbose than an extrative answer. The segment could then be used as
335
+ // input for LLMs to generate summaries and answers.
336
+ //
337
+ // If the number of matching segments is less than the
338
+ // max_extractive_segment_count, return all of the segments; otherwise,
339
+ // return the max_extractive_segment_count.
340
+ //
341
+ // Currently one segment will be returned for each SearchResult.
342
+ int32 max_extractive_segment_count = 2;
343
+ }
344
+
311
345
  // If there is no snippet spec provided, there will be no snippet in the
312
346
  // search result.
313
347
  SnippetSpec snippet_spec = 1;
@@ -315,6 +349,10 @@ message SearchRequest {
315
349
  // If there is no summary spec provided, there will be no summary in the
316
350
  // search response.
317
351
  SummarySpec summary_spec = 2;
352
+
353
+ // If there is no extractive_content_spec provided, there will be no
354
+ // extractive answer in the search response.
355
+ ExtractiveContentSpec extractive_content_spec = 3;
318
356
  }
319
357
 
320
358
  // Required. The resource name of the Search serving config, such as
@@ -382,6 +420,11 @@ message SearchRequest {
382
420
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
383
421
  string order_by = 8;
384
422
 
423
+ // Information about the end user.
424
+ // Highly recommended for analytics. The user_agent string in UserInfo will
425
+ // be used to deduce device_type for analytics.
426
+ UserInfo user_info = 21;
427
+
385
428
  // Facet specifications for faceted search. If empty, no facets are returned.
386
429
  //
387
430
  // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
@@ -393,16 +436,13 @@ message SearchRequest {
393
436
 
394
437
  // Additional search parameters.
395
438
  //
396
- // For
397
- // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
398
- // vertical, supported values are:
439
+ // For public website search only, supported values are:
399
440
  //
400
441
  // * `user_country_code`: string. Default empty. If set to non-empty, results
401
442
  // are restricted or boosted based on the location provided.
402
443
  // * `search_type`: double. Default empty. Enables non-webpage searching
403
444
  // depending on the value. The only valid non-default value is 1,
404
445
  // which enables image searching.
405
- // This field is ignored for other verticals.
406
446
  map<string, google.protobuf.Value> params = 11;
407
447
 
408
448
  // The query expansion specification that specifies the conditions under which
@@ -432,6 +472,29 @@ message SearchRequest {
432
472
  // The content search spec that configs the desired behavior of content
433
473
  // search.
434
474
  ContentSearchSpec content_search_spec = 24;
475
+
476
+ // Whether to turn on safe search. This is only supported for
477
+ // [ContentConfig.PUBLIC_WEBSITE][].
478
+ bool safe_search = 20;
479
+
480
+ // The user labels applied to a resource must meet the following requirements:
481
+ //
482
+ // * Each resource can have multiple labels, up to a maximum of 64.
483
+ // * Each label must be a key-value pair.
484
+ // * Keys have a minimum length of 1 character and a maximum length of 63
485
+ // characters and cannot be empty. Values can be empty and have a maximum
486
+ // length of 63 characters.
487
+ // * Keys and values can contain only lowercase letters, numeric characters,
488
+ // underscores, and dashes. All characters must use UTF-8 encoding, and
489
+ // international characters are allowed.
490
+ // * The key portion of a label must be unique. However, you can use the same
491
+ // key with multiple resources.
492
+ // * Keys must start with a lowercase letter or international character.
493
+ //
494
+ // See [Google Cloud
495
+ // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
496
+ // for more details.
497
+ map<string, string> user_labels = 22;
435
498
  }
436
499
 
437
500
  // Response message for
@@ -524,6 +587,14 @@ message SearchResponse {
524
587
  // performance.
525
588
  string attribution_token = 4;
526
589
 
590
+ // The URI of a customer-defined redirect page. If redirect action is
591
+ // triggered, no search is performed, and only
592
+ // [redirect_uri][google.cloud.discoveryengine.v1beta.SearchResponse.redirect_uri]
593
+ // and
594
+ // [attribution_token][google.cloud.discoveryengine.v1beta.SearchResponse.attribution_token]
595
+ // are set in the response.
596
+ string redirect_uri = 12;
597
+
527
598
  // A token that can be sent as
528
599
  // [SearchRequest.page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
529
600
  // to retrieve the next page. If this field is omitted, there are no