@google-cloud/discoveryengine 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.7.0...discoveryengine-v0.8.0) (2023-06-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * [discoveryengine] support extractive content in search ([#4355](https://github.com/googleapis/google-cloud-node/issues/4355)) ([5958cfa](https://github.com/googleapis/google-cloud-node/commit/5958cfa56bd5280301f446a8863d6461ea86493e))
9
+
3
10
  ## [0.7.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.6.0...discoveryengine-v0.7.0) (2023-06-14)
4
11
 
5
12
 
@@ -74,6 +74,8 @@ message CompleteQueryRequest {
74
74
  // API calls. Do not use it when there is no traffic for Search API.
75
75
  // * `user-event` - Using suggestions generated from user-imported search
76
76
  // events.
77
+ // * `document-completable` - Using suggestions taken directly from
78
+ // user-imported document fields marked as completable.
77
79
  //
78
80
  // Default values:
79
81
  //
@@ -59,8 +59,11 @@ message Document {
59
59
 
60
60
  // The MIME type of the content. Supported types:
61
61
  //
62
- // * `application/pdf` (PDF)
62
+ // * `application/pdf` (PDF, only native PDFs are supported for now)
63
63
  // * `text/html` (HTML)
64
+ // * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
65
+ // * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
66
+ // * `text/plain` (TXT)
64
67
  //
65
68
  // See https://www.iana.org/assignments/media-types/media-types.xhtml.
66
69
  string mime_type = 1;
@@ -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
@@ -290,7 +294,7 @@ message ImportDocumentsRequest {
290
294
  // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
291
295
  // or
292
296
  // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
293
- // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
297
+ // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
294
298
  bool auto_generate_ids = 8;
295
299
 
296
300
  // The field in the Cloud Storage and BigQuery sources that indicates 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
@@ -549,6 +587,14 @@ message SearchResponse {
549
587
  // performance.
550
588
  string attribution_token = 4;
551
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
+
552
598
  // A token that can be sent as
553
599
  // [SearchRequest.page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
554
600
  // to retrieve the next page. If this field is omitted, there are no
@@ -13407,6 +13407,9 @@ export namespace google {
13407
13407
 
13408
13408
  /** ContentSearchSpec summarySpec */
13409
13409
  summarySpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null);
13410
+
13411
+ /** ContentSearchSpec extractiveContentSpec */
13412
+ extractiveContentSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null);
13410
13413
  }
13411
13414
 
13412
13415
  /** Represents a ContentSearchSpec. */
@@ -13424,6 +13427,9 @@ export namespace google {
13424
13427
  /** ContentSearchSpec summarySpec. */
13425
13428
  public summarySpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null);
13426
13429
 
13430
+ /** ContentSearchSpec extractiveContentSpec. */
13431
+ public extractiveContentSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null);
13432
+
13427
13433
  /**
13428
13434
  * Creates a new ContentSearchSpec instance using the specified properties.
13429
13435
  * @param [properties] Properties to set
@@ -13703,6 +13709,109 @@ export namespace google {
13703
13709
  */
13704
13710
  public static getTypeUrl(typeUrlPrefix?: string): string;
13705
13711
  }
13712
+
13713
+ /** Properties of an ExtractiveContentSpec. */
13714
+ interface IExtractiveContentSpec {
13715
+
13716
+ /** ExtractiveContentSpec maxExtractiveAnswerCount */
13717
+ maxExtractiveAnswerCount?: (number|null);
13718
+
13719
+ /** ExtractiveContentSpec maxExtractiveSegmentCount */
13720
+ maxExtractiveSegmentCount?: (number|null);
13721
+ }
13722
+
13723
+ /** Represents an ExtractiveContentSpec. */
13724
+ class ExtractiveContentSpec implements IExtractiveContentSpec {
13725
+
13726
+ /**
13727
+ * Constructs a new ExtractiveContentSpec.
13728
+ * @param [properties] Properties to set
13729
+ */
13730
+ constructor(properties?: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec);
13731
+
13732
+ /** ExtractiveContentSpec maxExtractiveAnswerCount. */
13733
+ public maxExtractiveAnswerCount: number;
13734
+
13735
+ /** ExtractiveContentSpec maxExtractiveSegmentCount. */
13736
+ public maxExtractiveSegmentCount: number;
13737
+
13738
+ /**
13739
+ * Creates a new ExtractiveContentSpec instance using the specified properties.
13740
+ * @param [properties] Properties to set
13741
+ * @returns ExtractiveContentSpec instance
13742
+ */
13743
+ public static create(properties?: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec;
13744
+
13745
+ /**
13746
+ * Encodes the specified ExtractiveContentSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages.
13747
+ * @param message ExtractiveContentSpec message or plain object to encode
13748
+ * @param [writer] Writer to encode to
13749
+ * @returns Writer
13750
+ */
13751
+ public static encode(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec, writer?: $protobuf.Writer): $protobuf.Writer;
13752
+
13753
+ /**
13754
+ * Encodes the specified ExtractiveContentSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages.
13755
+ * @param message ExtractiveContentSpec message or plain object to encode
13756
+ * @param [writer] Writer to encode to
13757
+ * @returns Writer
13758
+ */
13759
+ public static encodeDelimited(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec, writer?: $protobuf.Writer): $protobuf.Writer;
13760
+
13761
+ /**
13762
+ * Decodes an ExtractiveContentSpec message from the specified reader or buffer.
13763
+ * @param reader Reader or buffer to decode from
13764
+ * @param [length] Message length if known beforehand
13765
+ * @returns ExtractiveContentSpec
13766
+ * @throws {Error} If the payload is not a reader or valid buffer
13767
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
13768
+ */
13769
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec;
13770
+
13771
+ /**
13772
+ * Decodes an ExtractiveContentSpec message from the specified reader or buffer, length delimited.
13773
+ * @param reader Reader or buffer to decode from
13774
+ * @returns ExtractiveContentSpec
13775
+ * @throws {Error} If the payload is not a reader or valid buffer
13776
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
13777
+ */
13778
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec;
13779
+
13780
+ /**
13781
+ * Verifies an ExtractiveContentSpec message.
13782
+ * @param message Plain object to verify
13783
+ * @returns `null` if valid, otherwise the reason why it is not
13784
+ */
13785
+ public static verify(message: { [k: string]: any }): (string|null);
13786
+
13787
+ /**
13788
+ * Creates an ExtractiveContentSpec message from a plain object. Also converts values to their respective internal types.
13789
+ * @param object Plain object
13790
+ * @returns ExtractiveContentSpec
13791
+ */
13792
+ public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec;
13793
+
13794
+ /**
13795
+ * Creates a plain object from an ExtractiveContentSpec message. Also converts values to other types if specified.
13796
+ * @param message ExtractiveContentSpec
13797
+ * @param [options] Conversion options
13798
+ * @returns Plain object
13799
+ */
13800
+ public static toObject(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec, options?: $protobuf.IConversionOptions): { [k: string]: any };
13801
+
13802
+ /**
13803
+ * Converts this ExtractiveContentSpec to JSON.
13804
+ * @returns JSON object
13805
+ */
13806
+ public toJSON(): { [k: string]: any };
13807
+
13808
+ /**
13809
+ * Gets the default type url for ExtractiveContentSpec
13810
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
13811
+ * @returns The default type url
13812
+ */
13813
+ public static getTypeUrl(typeUrlPrefix?: string): string;
13814
+ }
13706
13815
  }
13707
13816
  }
13708
13817
 
@@ -13724,6 +13833,9 @@ export namespace google {
13724
13833
  /** SearchResponse attributionToken */
13725
13834
  attributionToken?: (string|null);
13726
13835
 
13836
+ /** SearchResponse redirectUri */
13837
+ redirectUri?: (string|null);
13838
+
13727
13839
  /** SearchResponse nextPageToken */
13728
13840
  nextPageToken?: (string|null);
13729
13841
 
@@ -13761,6 +13873,9 @@ export namespace google {
13761
13873
  /** SearchResponse attributionToken. */
13762
13874
  public attributionToken: string;
13763
13875
 
13876
+ /** SearchResponse redirectUri. */
13877
+ public redirectUri: string;
13878
+
13764
13879
  /** SearchResponse nextPageToken. */
13765
13880
  public nextPageToken: string;
13766
13881
 
@@ -32858,6 +32858,7 @@
32858
32858
  * @interface IContentSearchSpec
32859
32859
  * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISnippetSpec|null} [snippetSpec] ContentSearchSpec snippetSpec
32860
32860
  * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null} [summarySpec] ContentSearchSpec summarySpec
32861
+ * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null} [extractiveContentSpec] ContentSearchSpec extractiveContentSpec
32861
32862
  */
32862
32863
 
32863
32864
  /**
@@ -32891,6 +32892,14 @@
32891
32892
  */
32892
32893
  ContentSearchSpec.prototype.summarySpec = null;
32893
32894
 
32895
+ /**
32896
+ * ContentSearchSpec extractiveContentSpec.
32897
+ * @member {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null|undefined} extractiveContentSpec
32898
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
32899
+ * @instance
32900
+ */
32901
+ ContentSearchSpec.prototype.extractiveContentSpec = null;
32902
+
32894
32903
  /**
32895
32904
  * Creates a new ContentSearchSpec instance using the specified properties.
32896
32905
  * @function create
@@ -32919,6 +32928,8 @@
32919
32928
  $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.encode(message.snippetSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
32920
32929
  if (message.summarySpec != null && Object.hasOwnProperty.call(message, "summarySpec"))
32921
32930
  $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.encode(message.summarySpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
32931
+ if (message.extractiveContentSpec != null && Object.hasOwnProperty.call(message, "extractiveContentSpec"))
32932
+ $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.encode(message.extractiveContentSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
32922
32933
  return writer;
32923
32934
  };
32924
32935
 
@@ -32961,6 +32972,10 @@
32961
32972
  message.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.decode(reader, reader.uint32());
32962
32973
  break;
32963
32974
  }
32975
+ case 3: {
32976
+ message.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.decode(reader, reader.uint32());
32977
+ break;
32978
+ }
32964
32979
  default:
32965
32980
  reader.skipType(tag & 7);
32966
32981
  break;
@@ -33006,6 +33021,11 @@
33006
33021
  if (error)
33007
33022
  return "summarySpec." + error;
33008
33023
  }
33024
+ if (message.extractiveContentSpec != null && message.hasOwnProperty("extractiveContentSpec")) {
33025
+ var error = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify(message.extractiveContentSpec);
33026
+ if (error)
33027
+ return "extractiveContentSpec." + error;
33028
+ }
33009
33029
  return null;
33010
33030
  };
33011
33031
 
@@ -33031,6 +33051,11 @@
33031
33051
  throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.summarySpec: object expected");
33032
33052
  message.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.fromObject(object.summarySpec);
33033
33053
  }
33054
+ if (object.extractiveContentSpec != null) {
33055
+ if (typeof object.extractiveContentSpec !== "object")
33056
+ throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.extractiveContentSpec: object expected");
33057
+ message.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.fromObject(object.extractiveContentSpec);
33058
+ }
33034
33059
  return message;
33035
33060
  };
33036
33061
 
@@ -33050,11 +33075,14 @@
33050
33075
  if (options.defaults) {
33051
33076
  object.snippetSpec = null;
33052
33077
  object.summarySpec = null;
33078
+ object.extractiveContentSpec = null;
33053
33079
  }
33054
33080
  if (message.snippetSpec != null && message.hasOwnProperty("snippetSpec"))
33055
33081
  object.snippetSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.toObject(message.snippetSpec, options);
33056
33082
  if (message.summarySpec != null && message.hasOwnProperty("summarySpec"))
33057
33083
  object.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.toObject(message.summarySpec, options);
33084
+ if (message.extractiveContentSpec != null && message.hasOwnProperty("extractiveContentSpec"))
33085
+ object.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.toObject(message.extractiveContentSpec, options);
33058
33086
  return object;
33059
33087
  };
33060
33088
 
@@ -33514,6 +33542,233 @@
33514
33542
  return SummarySpec;
33515
33543
  })();
33516
33544
 
33545
+ ContentSearchSpec.ExtractiveContentSpec = (function() {
33546
+
33547
+ /**
33548
+ * Properties of an ExtractiveContentSpec.
33549
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
33550
+ * @interface IExtractiveContentSpec
33551
+ * @property {number|null} [maxExtractiveAnswerCount] ExtractiveContentSpec maxExtractiveAnswerCount
33552
+ * @property {number|null} [maxExtractiveSegmentCount] ExtractiveContentSpec maxExtractiveSegmentCount
33553
+ */
33554
+
33555
+ /**
33556
+ * Constructs a new ExtractiveContentSpec.
33557
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
33558
+ * @classdesc Represents an ExtractiveContentSpec.
33559
+ * @implements IExtractiveContentSpec
33560
+ * @constructor
33561
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec=} [properties] Properties to set
33562
+ */
33563
+ function ExtractiveContentSpec(properties) {
33564
+ if (properties)
33565
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
33566
+ if (properties[keys[i]] != null)
33567
+ this[keys[i]] = properties[keys[i]];
33568
+ }
33569
+
33570
+ /**
33571
+ * ExtractiveContentSpec maxExtractiveAnswerCount.
33572
+ * @member {number} maxExtractiveAnswerCount
33573
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33574
+ * @instance
33575
+ */
33576
+ ExtractiveContentSpec.prototype.maxExtractiveAnswerCount = 0;
33577
+
33578
+ /**
33579
+ * ExtractiveContentSpec maxExtractiveSegmentCount.
33580
+ * @member {number} maxExtractiveSegmentCount
33581
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33582
+ * @instance
33583
+ */
33584
+ ExtractiveContentSpec.prototype.maxExtractiveSegmentCount = 0;
33585
+
33586
+ /**
33587
+ * Creates a new ExtractiveContentSpec instance using the specified properties.
33588
+ * @function create
33589
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33590
+ * @static
33591
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec=} [properties] Properties to set
33592
+ * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec instance
33593
+ */
33594
+ ExtractiveContentSpec.create = function create(properties) {
33595
+ return new ExtractiveContentSpec(properties);
33596
+ };
33597
+
33598
+ /**
33599
+ * Encodes the specified ExtractiveContentSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages.
33600
+ * @function encode
33601
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33602
+ * @static
33603
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec} message ExtractiveContentSpec message or plain object to encode
33604
+ * @param {$protobuf.Writer} [writer] Writer to encode to
33605
+ * @returns {$protobuf.Writer} Writer
33606
+ */
33607
+ ExtractiveContentSpec.encode = function encode(message, writer) {
33608
+ if (!writer)
33609
+ writer = $Writer.create();
33610
+ if (message.maxExtractiveAnswerCount != null && Object.hasOwnProperty.call(message, "maxExtractiveAnswerCount"))
33611
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxExtractiveAnswerCount);
33612
+ if (message.maxExtractiveSegmentCount != null && Object.hasOwnProperty.call(message, "maxExtractiveSegmentCount"))
33613
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxExtractiveSegmentCount);
33614
+ return writer;
33615
+ };
33616
+
33617
+ /**
33618
+ * Encodes the specified ExtractiveContentSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages.
33619
+ * @function encodeDelimited
33620
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33621
+ * @static
33622
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec} message ExtractiveContentSpec message or plain object to encode
33623
+ * @param {$protobuf.Writer} [writer] Writer to encode to
33624
+ * @returns {$protobuf.Writer} Writer
33625
+ */
33626
+ ExtractiveContentSpec.encodeDelimited = function encodeDelimited(message, writer) {
33627
+ return this.encode(message, writer).ldelim();
33628
+ };
33629
+
33630
+ /**
33631
+ * Decodes an ExtractiveContentSpec message from the specified reader or buffer.
33632
+ * @function decode
33633
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33634
+ * @static
33635
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
33636
+ * @param {number} [length] Message length if known beforehand
33637
+ * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec
33638
+ * @throws {Error} If the payload is not a reader or valid buffer
33639
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
33640
+ */
33641
+ ExtractiveContentSpec.decode = function decode(reader, length) {
33642
+ if (!(reader instanceof $Reader))
33643
+ reader = $Reader.create(reader);
33644
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec();
33645
+ while (reader.pos < end) {
33646
+ var tag = reader.uint32();
33647
+ switch (tag >>> 3) {
33648
+ case 1: {
33649
+ message.maxExtractiveAnswerCount = reader.int32();
33650
+ break;
33651
+ }
33652
+ case 2: {
33653
+ message.maxExtractiveSegmentCount = reader.int32();
33654
+ break;
33655
+ }
33656
+ default:
33657
+ reader.skipType(tag & 7);
33658
+ break;
33659
+ }
33660
+ }
33661
+ return message;
33662
+ };
33663
+
33664
+ /**
33665
+ * Decodes an ExtractiveContentSpec message from the specified reader or buffer, length delimited.
33666
+ * @function decodeDelimited
33667
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33668
+ * @static
33669
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
33670
+ * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec
33671
+ * @throws {Error} If the payload is not a reader or valid buffer
33672
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
33673
+ */
33674
+ ExtractiveContentSpec.decodeDelimited = function decodeDelimited(reader) {
33675
+ if (!(reader instanceof $Reader))
33676
+ reader = new $Reader(reader);
33677
+ return this.decode(reader, reader.uint32());
33678
+ };
33679
+
33680
+ /**
33681
+ * Verifies an ExtractiveContentSpec message.
33682
+ * @function verify
33683
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33684
+ * @static
33685
+ * @param {Object.<string,*>} message Plain object to verify
33686
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
33687
+ */
33688
+ ExtractiveContentSpec.verify = function verify(message) {
33689
+ if (typeof message !== "object" || message === null)
33690
+ return "object expected";
33691
+ if (message.maxExtractiveAnswerCount != null && message.hasOwnProperty("maxExtractiveAnswerCount"))
33692
+ if (!$util.isInteger(message.maxExtractiveAnswerCount))
33693
+ return "maxExtractiveAnswerCount: integer expected";
33694
+ if (message.maxExtractiveSegmentCount != null && message.hasOwnProperty("maxExtractiveSegmentCount"))
33695
+ if (!$util.isInteger(message.maxExtractiveSegmentCount))
33696
+ return "maxExtractiveSegmentCount: integer expected";
33697
+ return null;
33698
+ };
33699
+
33700
+ /**
33701
+ * Creates an ExtractiveContentSpec message from a plain object. Also converts values to their respective internal types.
33702
+ * @function fromObject
33703
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33704
+ * @static
33705
+ * @param {Object.<string,*>} object Plain object
33706
+ * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec
33707
+ */
33708
+ ExtractiveContentSpec.fromObject = function fromObject(object) {
33709
+ if (object instanceof $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec)
33710
+ return object;
33711
+ var message = new $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec();
33712
+ if (object.maxExtractiveAnswerCount != null)
33713
+ message.maxExtractiveAnswerCount = object.maxExtractiveAnswerCount | 0;
33714
+ if (object.maxExtractiveSegmentCount != null)
33715
+ message.maxExtractiveSegmentCount = object.maxExtractiveSegmentCount | 0;
33716
+ return message;
33717
+ };
33718
+
33719
+ /**
33720
+ * Creates a plain object from an ExtractiveContentSpec message. Also converts values to other types if specified.
33721
+ * @function toObject
33722
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33723
+ * @static
33724
+ * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} message ExtractiveContentSpec
33725
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
33726
+ * @returns {Object.<string,*>} Plain object
33727
+ */
33728
+ ExtractiveContentSpec.toObject = function toObject(message, options) {
33729
+ if (!options)
33730
+ options = {};
33731
+ var object = {};
33732
+ if (options.defaults) {
33733
+ object.maxExtractiveAnswerCount = 0;
33734
+ object.maxExtractiveSegmentCount = 0;
33735
+ }
33736
+ if (message.maxExtractiveAnswerCount != null && message.hasOwnProperty("maxExtractiveAnswerCount"))
33737
+ object.maxExtractiveAnswerCount = message.maxExtractiveAnswerCount;
33738
+ if (message.maxExtractiveSegmentCount != null && message.hasOwnProperty("maxExtractiveSegmentCount"))
33739
+ object.maxExtractiveSegmentCount = message.maxExtractiveSegmentCount;
33740
+ return object;
33741
+ };
33742
+
33743
+ /**
33744
+ * Converts this ExtractiveContentSpec to JSON.
33745
+ * @function toJSON
33746
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33747
+ * @instance
33748
+ * @returns {Object.<string,*>} JSON object
33749
+ */
33750
+ ExtractiveContentSpec.prototype.toJSON = function toJSON() {
33751
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
33752
+ };
33753
+
33754
+ /**
33755
+ * Gets the default type url for ExtractiveContentSpec
33756
+ * @function getTypeUrl
33757
+ * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec
33758
+ * @static
33759
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
33760
+ * @returns {string} The default type url
33761
+ */
33762
+ ExtractiveContentSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
33763
+ if (typeUrlPrefix === undefined) {
33764
+ typeUrlPrefix = "type.googleapis.com";
33765
+ }
33766
+ return typeUrlPrefix + "/google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec";
33767
+ };
33768
+
33769
+ return ExtractiveContentSpec;
33770
+ })();
33771
+
33517
33772
  return ContentSearchSpec;
33518
33773
  })();
33519
33774
 
@@ -33531,6 +33786,7 @@
33531
33786
  * @property {google.cloud.discoveryengine.v1beta.SearchResponse.IGuidedSearchResult|null} [guidedSearchResult] SearchResponse guidedSearchResult
33532
33787
  * @property {number|null} [totalSize] SearchResponse totalSize
33533
33788
  * @property {string|null} [attributionToken] SearchResponse attributionToken
33789
+ * @property {string|null} [redirectUri] SearchResponse redirectUri
33534
33790
  * @property {string|null} [nextPageToken] SearchResponse nextPageToken
33535
33791
  * @property {string|null} [correctedQuery] SearchResponse correctedQuery
33536
33792
  * @property {google.cloud.discoveryengine.v1beta.SearchResponse.ISummary|null} [summary] SearchResponse summary
@@ -33595,6 +33851,14 @@
33595
33851
  */
33596
33852
  SearchResponse.prototype.attributionToken = "";
33597
33853
 
33854
+ /**
33855
+ * SearchResponse redirectUri.
33856
+ * @member {string} redirectUri
33857
+ * @memberof google.cloud.discoveryengine.v1beta.SearchResponse
33858
+ * @instance
33859
+ */
33860
+ SearchResponse.prototype.redirectUri = "";
33861
+
33598
33862
  /**
33599
33863
  * SearchResponse nextPageToken.
33600
33864
  * @member {string} nextPageToken
@@ -33672,6 +33936,8 @@
33672
33936
  if (message.appliedControls != null && message.appliedControls.length)
33673
33937
  for (var i = 0; i < message.appliedControls.length; ++i)
33674
33938
  writer.uint32(/* id 10, wireType 2 =*/82).string(message.appliedControls[i]);
33939
+ if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri"))
33940
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.redirectUri);
33675
33941
  return writer;
33676
33942
  };
33677
33943
 
@@ -33730,6 +33996,10 @@
33730
33996
  message.attributionToken = reader.string();
33731
33997
  break;
33732
33998
  }
33999
+ case 12: {
34000
+ message.redirectUri = reader.string();
34001
+ break;
34002
+ }
33733
34003
  case 5: {
33734
34004
  message.nextPageToken = reader.string();
33735
34005
  break;
@@ -33812,6 +34082,9 @@
33812
34082
  if (message.attributionToken != null && message.hasOwnProperty("attributionToken"))
33813
34083
  if (!$util.isString(message.attributionToken))
33814
34084
  return "attributionToken: string expected";
34085
+ if (message.redirectUri != null && message.hasOwnProperty("redirectUri"))
34086
+ if (!$util.isString(message.redirectUri))
34087
+ return "redirectUri: string expected";
33815
34088
  if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
33816
34089
  if (!$util.isString(message.nextPageToken))
33817
34090
  return "nextPageToken: string expected";
@@ -33874,6 +34147,8 @@
33874
34147
  message.totalSize = object.totalSize | 0;
33875
34148
  if (object.attributionToken != null)
33876
34149
  message.attributionToken = String(object.attributionToken);
34150
+ if (object.redirectUri != null)
34151
+ message.redirectUri = String(object.redirectUri);
33877
34152
  if (object.nextPageToken != null)
33878
34153
  message.nextPageToken = String(object.nextPageToken);
33879
34154
  if (object.correctedQuery != null)
@@ -33918,6 +34193,7 @@
33918
34193
  object.correctedQuery = "";
33919
34194
  object.guidedSearchResult = null;
33920
34195
  object.summary = null;
34196
+ object.redirectUri = "";
33921
34197
  }
33922
34198
  if (message.results && message.results.length) {
33923
34199
  object.results = [];
@@ -33946,6 +34222,8 @@
33946
34222
  for (var j = 0; j < message.appliedControls.length; ++j)
33947
34223
  object.appliedControls[j] = message.appliedControls[j];
33948
34224
  }
34225
+ if (message.redirectUri != null && message.hasOwnProperty("redirectUri"))
34226
+ object.redirectUri = message.redirectUri;
33949
34227
  return object;
33950
34228
  };
33951
34229
 
@@ -2386,24 +2386,15 @@
2386
2386
  "fields": {
2387
2387
  "inlineSource": {
2388
2388
  "type": "InlineSource",
2389
- "id": 2,
2390
- "options": {
2391
- "(google.api.field_behavior)": "REQUIRED"
2392
- }
2389
+ "id": 2
2393
2390
  },
2394
2391
  "gcsSource": {
2395
2392
  "type": "GcsSource",
2396
- "id": 3,
2397
- "options": {
2398
- "(google.api.field_behavior)": "REQUIRED"
2399
- }
2393
+ "id": 3
2400
2394
  },
2401
2395
  "bigquerySource": {
2402
2396
  "type": "BigQuerySource",
2403
- "id": 4,
2404
- "options": {
2405
- "(google.api.field_behavior)": "REQUIRED"
2406
- }
2397
+ "id": 4
2407
2398
  },
2408
2399
  "parent": {
2409
2400
  "type": "string",
@@ -3623,6 +3614,10 @@
3623
3614
  "summarySpec": {
3624
3615
  "type": "SummarySpec",
3625
3616
  "id": 2
3617
+ },
3618
+ "extractiveContentSpec": {
3619
+ "type": "ExtractiveContentSpec",
3620
+ "id": 3
3626
3621
  }
3627
3622
  },
3628
3623
  "nested": {
@@ -3645,6 +3640,18 @@
3645
3640
  "id": 1
3646
3641
  }
3647
3642
  }
3643
+ },
3644
+ "ExtractiveContentSpec": {
3645
+ "fields": {
3646
+ "maxExtractiveAnswerCount": {
3647
+ "type": "int32",
3648
+ "id": 1
3649
+ },
3650
+ "maxExtractiveSegmentCount": {
3651
+ "type": "int32",
3652
+ "id": 2
3653
+ }
3654
+ }
3648
3655
  }
3649
3656
  }
3650
3657
  }
@@ -3674,6 +3681,10 @@
3674
3681
  "type": "string",
3675
3682
  "id": 4
3676
3683
  },
3684
+ "redirectUri": {
3685
+ "type": "string",
3686
+ "id": 12
3687
+ },
3677
3688
  "nextPageToken": {
3678
3689
  "type": "string",
3679
3690
  "id": 5
@@ -127,6 +127,8 @@ export declare class CompletionServiceClient {
127
127
  * API calls. Do not use it when there is no traffic for Search API.
128
128
  * * `user-event` - Using suggestions generated from user-imported search
129
129
  * events.
130
+ * * `document-completable` - Using suggestions taken directly from
131
+ * user-imported document fields marked as completable.
130
132
  *
131
133
  * Default values:
132
134
  *
@@ -308,7 +308,7 @@ export declare class DocumentServiceClient {
308
308
  * {@link google.cloud.discoveryengine.v1beta.GcsSource.data_schema|GcsSource.data_schema}
309
309
  * or
310
310
  * {@link google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema|BigQuerySource.data_schema}
311
- * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
311
+ * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
312
312
  * @param {string} request.idField
313
313
  * The field in the Cloud Storage and BigQuery sources that indicates the
314
314
  * unique IDs of the documents.
@@ -186,11 +186,11 @@ export declare class UserEventServiceClient {
186
186
  * @param {Object} request
187
187
  * The request object that will be sent.
188
188
  * @param {google.cloud.discoveryengine.v1beta.ImportUserEventsRequest.InlineSource} request.inlineSource
189
- * Required. The Inline source for the input content for UserEvents.
189
+ * The Inline source for the input content for UserEvents.
190
190
  * @param {google.cloud.discoveryengine.v1beta.GcsSource} request.gcsSource
191
- * Required. Cloud Storage location for the input content.
191
+ * Cloud Storage location for the input content.
192
192
  * @param {google.cloud.discoveryengine.v1beta.BigQuerySource} request.bigquerySource
193
- * Required. BigQuery input source.
193
+ * BigQuery input source.
194
194
  * @param {string} request.parent
195
195
  * Required. Parent DataStore resource name, of the form
196
196
  * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/discoveryengine",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Discovery Engine API client for Node.js",
5
5
  "repository": {
6
6
  "type": "git",