diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/completion_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/completion_service.proto index 5a8ecd29acc..cd003bd1fa2 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/completion_service.proto @@ -74,6 +74,8 @@ message CompleteQueryRequest { // API calls. Do not use it when there is no traffic for Search API. // * `user-event` - Using suggestions generated from user-imported search // events. + // * `document-completable` - Using suggestions taken directly from + // user-imported document fields marked as completable. // // Default values: // diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/document.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/document.proto index 67e178c508f..677228d9011 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/document.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/document.proto @@ -59,8 +59,11 @@ message Document { // The MIME type of the content. Supported types: // - // * `application/pdf` (PDF) + // * `application/pdf` (PDF, only native PDFs are supported for now) // * `text/html` (HTML) + // * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) + // * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) + // * `text/plain` (TXT) // // See https://www.iana.org/assignments/media-types/media-types.xhtml. string mime_type = 1; diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto index 9a901c90b8e..9c68d47a0fe 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto @@ -60,6 +60,10 @@ message GcsSource { // * `custom`: One custom data JSON per row in arbitrary format that conforms // the defined [Schema][google.cloud.discoveryengine.v1beta.Schema] of the // data store. This can only be used by the GENERIC Data Store vertical. + // * `csv`: A CSV file with header conforming the defined + // [Schema][google.cloud.discoveryengine.v1beta.Schema] of the + // data store. Each entry after the header will be imported as a Document. + // This can only be used by the GENERIC Data Store vertical. // // Supported values for user even imports: // @@ -137,16 +141,16 @@ message ImportUserEventsRequest { repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED]; } - // The desired input source of the user event data. + // Required - The desired input source of the user event data. oneof source { - // Required. The Inline source for the input content for UserEvents. - InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED]; + // The Inline source for the input content for UserEvents. + InlineSource inline_source = 2; - // Required. Cloud Storage location for the input content. - GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED]; + // Cloud Storage location for the input content. + GcsSource gcs_source = 3; - // Required. BigQuery input source. - BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED]; + // BigQuery input source. + BigQuerySource bigquery_source = 4; } // Required. Parent DataStore resource name, of the form @@ -290,7 +294,7 @@ message ImportDocumentsRequest { // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema] // or // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema] - // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. bool auto_generate_ids = 8; // The field in the Cloud Storage and BigQuery sources that indicates the diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto index 393f2313a34..21c48e0734d 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto @@ -287,6 +287,10 @@ message SearchRequest { // The specification that configs the snippet in the search results. message SnippetSpec { // Max number of snippets returned in each search result. + // + // A snippet is an infomartive summary of a content with highlighting for + // UI rendering. + // // If the matching snippets is less than the max_snippet_count, return all // of the snippets; otherwise, return the max_snippet_count. // @@ -308,6 +312,36 @@ message SearchRequest { int32 summary_result_count = 1; } + // The specification that configs the extractive content in search results. + message ExtractiveContentSpec { + // The max number of extractive answers returned in each search result. + // + // An extractive answer is a verbatim answer extracted from the original + // document, which provides precise and contextually relevant answer to + // the search query. + // + // If the number of matching answers is less than the + // extractive_answer_count, return all of the answers; otherwise, return + // the extractive_answer_count. + // + // At most 5 answers will be returned for each SearchResult. + int32 max_extractive_answer_count = 1; + + // The max number of extractive segments returned in each search result. + // + // An extractive segment is a text segment extracted from the original + // document which is relevant to the search query and in general more + // verbose than an extrative answer. The segment could then be used as + // input for LLMs to generate summaries and answers. + // + // If the number of matching segments is less than the + // max_extractive_segment_count, return all of the segments; otherwise, + // return the max_extractive_segment_count. + // + // Currently one segment will be returned for each SearchResult. + int32 max_extractive_segment_count = 2; + } + // If there is no snippet spec provided, there will be no snippet in the // search result. SnippetSpec snippet_spec = 1; @@ -315,6 +349,10 @@ message SearchRequest { // If there is no summary spec provided, there will be no summary in the // search response. SummarySpec summary_spec = 2; + + // If there is no extractive_content_spec provided, there will be no + // extractive answer in the search response. + ExtractiveContentSpec extractive_content_spec = 3; } // Required. The resource name of the Search serving config, such as @@ -549,6 +587,14 @@ message SearchResponse { // performance. string attribution_token = 4; + // The URI of a customer-defined redirect page. If redirect action is + // triggered, no search is performed, and only + // [redirect_uri][google.cloud.discoveryengine.v1beta.SearchResponse.redirect_uri] + // and + // [attribution_token][google.cloud.discoveryengine.v1beta.SearchResponse.attribution_token] + // are set in the response. + string redirect_uri = 12; + // A token that can be sent as // [SearchRequest.page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token] // to retrieve the next page. If this field is omitted, there are no diff --git a/packages/google-cloud-discoveryengine/protos/protos.d.ts b/packages/google-cloud-discoveryengine/protos/protos.d.ts index 4c76f6c18a1..e305a6e0dc8 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.d.ts +++ b/packages/google-cloud-discoveryengine/protos/protos.d.ts @@ -13407,6 +13407,9 @@ export namespace google { /** ContentSearchSpec summarySpec */ summarySpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null); + + /** ContentSearchSpec extractiveContentSpec */ + extractiveContentSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null); } /** Represents a ContentSearchSpec. */ @@ -13424,6 +13427,9 @@ export namespace google { /** ContentSearchSpec summarySpec. */ public summarySpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null); + /** ContentSearchSpec extractiveContentSpec. */ + public extractiveContentSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null); + /** * Creates a new ContentSearchSpec instance using the specified properties. * @param [properties] Properties to set @@ -13703,6 +13709,109 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an ExtractiveContentSpec. */ + interface IExtractiveContentSpec { + + /** ExtractiveContentSpec maxExtractiveAnswerCount */ + maxExtractiveAnswerCount?: (number|null); + + /** ExtractiveContentSpec maxExtractiveSegmentCount */ + maxExtractiveSegmentCount?: (number|null); + } + + /** Represents an ExtractiveContentSpec. */ + class ExtractiveContentSpec implements IExtractiveContentSpec { + + /** + * Constructs a new ExtractiveContentSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec); + + /** ExtractiveContentSpec maxExtractiveAnswerCount. */ + public maxExtractiveAnswerCount: number; + + /** ExtractiveContentSpec maxExtractiveSegmentCount. */ + public maxExtractiveSegmentCount: number; + + /** + * Creates a new ExtractiveContentSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtractiveContentSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec; + + /** + * Encodes the specified ExtractiveContentSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages. + * @param message ExtractiveContentSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtractiveContentSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages. + * @param message ExtractiveContentSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtractiveContentSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtractiveContentSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec; + + /** + * Decodes an ExtractiveContentSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtractiveContentSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec; + + /** + * Verifies an ExtractiveContentSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtractiveContentSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtractiveContentSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec; + + /** + * Creates a plain object from an ExtractiveContentSpec message. Also converts values to other types if specified. + * @param message ExtractiveContentSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtractiveContentSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtractiveContentSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } @@ -13724,6 +13833,9 @@ export namespace google { /** SearchResponse attributionToken */ attributionToken?: (string|null); + /** SearchResponse redirectUri */ + redirectUri?: (string|null); + /** SearchResponse nextPageToken */ nextPageToken?: (string|null); @@ -13761,6 +13873,9 @@ export namespace google { /** SearchResponse attributionToken. */ public attributionToken: string; + /** SearchResponse redirectUri. */ + public redirectUri: string; + /** SearchResponse nextPageToken. */ public nextPageToken: string; diff --git a/packages/google-cloud-discoveryengine/protos/protos.js b/packages/google-cloud-discoveryengine/protos/protos.js index ef84e523ed4..9e0a5d2f300 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.js +++ b/packages/google-cloud-discoveryengine/protos/protos.js @@ -32858,6 +32858,7 @@ * @interface IContentSearchSpec * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISnippetSpec|null} [snippetSpec] ContentSearchSpec snippetSpec * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ISummarySpec|null} [summarySpec] ContentSearchSpec summarySpec + * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null} [extractiveContentSpec] ContentSearchSpec extractiveContentSpec */ /** @@ -32891,6 +32892,14 @@ */ ContentSearchSpec.prototype.summarySpec = null; + /** + * ContentSearchSpec extractiveContentSpec. + * @member {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null|undefined} extractiveContentSpec + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + * @instance + */ + ContentSearchSpec.prototype.extractiveContentSpec = null; + /** * Creates a new ContentSearchSpec instance using the specified properties. * @function create @@ -32919,6 +32928,8 @@ $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.encode(message.snippetSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.summarySpec != null && Object.hasOwnProperty.call(message, "summarySpec")) $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.encode(message.summarySpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.extractiveContentSpec != null && Object.hasOwnProperty.call(message, "extractiveContentSpec")) + $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.encode(message.extractiveContentSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -32961,6 +32972,10 @@ message.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.decode(reader, reader.uint32()); break; } + case 3: { + message.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -33006,6 +33021,11 @@ if (error) return "summarySpec." + error; } + if (message.extractiveContentSpec != null && message.hasOwnProperty("extractiveContentSpec")) { + var error = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify(message.extractiveContentSpec); + if (error) + return "extractiveContentSpec." + error; + } return null; }; @@ -33031,6 +33051,11 @@ throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.summarySpec: object expected"); message.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.fromObject(object.summarySpec); } + if (object.extractiveContentSpec != null) { + if (typeof object.extractiveContentSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.extractiveContentSpec: object expected"); + message.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.fromObject(object.extractiveContentSpec); + } return message; }; @@ -33050,11 +33075,14 @@ if (options.defaults) { object.snippetSpec = null; object.summarySpec = null; + object.extractiveContentSpec = null; } if (message.snippetSpec != null && message.hasOwnProperty("snippetSpec")) object.snippetSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.toObject(message.snippetSpec, options); if (message.summarySpec != null && message.hasOwnProperty("summarySpec")) object.summarySpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.toObject(message.summarySpec, options); + if (message.extractiveContentSpec != null && message.hasOwnProperty("extractiveContentSpec")) + object.extractiveContentSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.toObject(message.extractiveContentSpec, options); return object; }; @@ -33514,6 +33542,233 @@ return SummarySpec; })(); + ContentSearchSpec.ExtractiveContentSpec = (function() { + + /** + * Properties of an ExtractiveContentSpec. + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + * @interface IExtractiveContentSpec + * @property {number|null} [maxExtractiveAnswerCount] ExtractiveContentSpec maxExtractiveAnswerCount + * @property {number|null} [maxExtractiveSegmentCount] ExtractiveContentSpec maxExtractiveSegmentCount + */ + + /** + * Constructs a new ExtractiveContentSpec. + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + * @classdesc Represents an ExtractiveContentSpec. + * @implements IExtractiveContentSpec + * @constructor + * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec=} [properties] Properties to set + */ + function ExtractiveContentSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtractiveContentSpec maxExtractiveAnswerCount. + * @member {number} maxExtractiveAnswerCount + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @instance + */ + ExtractiveContentSpec.prototype.maxExtractiveAnswerCount = 0; + + /** + * ExtractiveContentSpec maxExtractiveSegmentCount. + * @member {number} maxExtractiveSegmentCount + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @instance + */ + ExtractiveContentSpec.prototype.maxExtractiveSegmentCount = 0; + + /** + * Creates a new ExtractiveContentSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec instance + */ + ExtractiveContentSpec.create = function create(properties) { + return new ExtractiveContentSpec(properties); + }; + + /** + * Encodes the specified ExtractiveContentSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec} message ExtractiveContentSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractiveContentSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxExtractiveAnswerCount != null && Object.hasOwnProperty.call(message, "maxExtractiveAnswerCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxExtractiveAnswerCount); + if (message.maxExtractiveSegmentCount != null && Object.hasOwnProperty.call(message, "maxExtractiveSegmentCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxExtractiveSegmentCount); + return writer; + }; + + /** + * Encodes the specified ExtractiveContentSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.IExtractiveContentSpec} message ExtractiveContentSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractiveContentSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtractiveContentSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractiveContentSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxExtractiveAnswerCount = reader.int32(); + break; + } + case 2: { + message.maxExtractiveSegmentCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtractiveContentSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractiveContentSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtractiveContentSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtractiveContentSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxExtractiveAnswerCount != null && message.hasOwnProperty("maxExtractiveAnswerCount")) + if (!$util.isInteger(message.maxExtractiveAnswerCount)) + return "maxExtractiveAnswerCount: integer expected"; + if (message.maxExtractiveSegmentCount != null && message.hasOwnProperty("maxExtractiveSegmentCount")) + if (!$util.isInteger(message.maxExtractiveSegmentCount)) + return "maxExtractiveSegmentCount: integer expected"; + return null; + }; + + /** + * Creates an ExtractiveContentSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} ExtractiveContentSpec + */ + ExtractiveContentSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec(); + if (object.maxExtractiveAnswerCount != null) + message.maxExtractiveAnswerCount = object.maxExtractiveAnswerCount | 0; + if (object.maxExtractiveSegmentCount != null) + message.maxExtractiveSegmentCount = object.maxExtractiveSegmentCount | 0; + return message; + }; + + /** + * Creates a plain object from an ExtractiveContentSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} message ExtractiveContentSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtractiveContentSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxExtractiveAnswerCount = 0; + object.maxExtractiveSegmentCount = 0; + } + if (message.maxExtractiveAnswerCount != null && message.hasOwnProperty("maxExtractiveAnswerCount")) + object.maxExtractiveAnswerCount = message.maxExtractiveAnswerCount; + if (message.maxExtractiveSegmentCount != null && message.hasOwnProperty("maxExtractiveSegmentCount")) + object.maxExtractiveSegmentCount = message.maxExtractiveSegmentCount; + return object; + }; + + /** + * Converts this ExtractiveContentSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @instance + * @returns {Object.} JSON object + */ + ExtractiveContentSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtractiveContentSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtractiveContentSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec"; + }; + + return ExtractiveContentSpec; + })(); + return ContentSearchSpec; })(); @@ -33531,6 +33786,7 @@ * @property {google.cloud.discoveryengine.v1beta.SearchResponse.IGuidedSearchResult|null} [guidedSearchResult] SearchResponse guidedSearchResult * @property {number|null} [totalSize] SearchResponse totalSize * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [redirectUri] SearchResponse redirectUri * @property {string|null} [nextPageToken] SearchResponse nextPageToken * @property {string|null} [correctedQuery] SearchResponse correctedQuery * @property {google.cloud.discoveryengine.v1beta.SearchResponse.ISummary|null} [summary] SearchResponse summary @@ -33595,6 +33851,14 @@ */ SearchResponse.prototype.attributionToken = ""; + /** + * SearchResponse redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.discoveryengine.v1beta.SearchResponse + * @instance + */ + SearchResponse.prototype.redirectUri = ""; + /** * SearchResponse nextPageToken. * @member {string} nextPageToken @@ -33672,6 +33936,8 @@ if (message.appliedControls != null && message.appliedControls.length) for (var i = 0; i < message.appliedControls.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.appliedControls[i]); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.redirectUri); return writer; }; @@ -33730,6 +33996,10 @@ message.attributionToken = reader.string(); break; } + case 12: { + message.redirectUri = reader.string(); + break; + } case 5: { message.nextPageToken = reader.string(); break; @@ -33812,6 +34082,9 @@ if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) if (!$util.isString(message.attributionToken)) return "attributionToken: string expected"; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; @@ -33874,6 +34147,8 @@ message.totalSize = object.totalSize | 0; if (object.attributionToken != null) message.attributionToken = String(object.attributionToken); + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.correctedQuery != null) @@ -33918,6 +34193,7 @@ object.correctedQuery = ""; object.guidedSearchResult = null; object.summary = null; + object.redirectUri = ""; } if (message.results && message.results.length) { object.results = []; @@ -33946,6 +34222,8 @@ for (var j = 0; j < message.appliedControls.length; ++j) object.appliedControls[j] = message.appliedControls[j]; } + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; return object; }; diff --git a/packages/google-cloud-discoveryengine/protos/protos.json b/packages/google-cloud-discoveryengine/protos/protos.json index cee19da20d9..ccca6f48448 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.json +++ b/packages/google-cloud-discoveryengine/protos/protos.json @@ -2386,24 +2386,15 @@ "fields": { "inlineSource": { "type": "InlineSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 2 }, "gcsSource": { "type": "GcsSource", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 3 }, "bigquerySource": { "type": "BigQuerySource", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 4 }, "parent": { "type": "string", @@ -3623,6 +3614,10 @@ "summarySpec": { "type": "SummarySpec", "id": 2 + }, + "extractiveContentSpec": { + "type": "ExtractiveContentSpec", + "id": 3 } }, "nested": { @@ -3645,6 +3640,18 @@ "id": 1 } } + }, + "ExtractiveContentSpec": { + "fields": { + "maxExtractiveAnswerCount": { + "type": "int32", + "id": 1 + }, + "maxExtractiveSegmentCount": { + "type": "int32", + "id": 2 + } + } } } } @@ -3674,6 +3681,10 @@ "type": "string", "id": 4 }, + "redirectUri": { + "type": "string", + "id": 12 + }, "nextPageToken": { "type": "string", "id": 5 diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js b/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js index 995d079ea2f..9100d412b8a 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js @@ -48,6 +48,8 @@ function main(dataStore, query) { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * Default values: * * `document` is the default model for regular dataStores. * * `search-history` is the default model for diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js index 129eba4de80..d737f12f8d3 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js @@ -75,7 +75,7 @@ function main(parent) { * GcsSource.data_schema google.cloud.discoveryengine.v1beta.GcsSource.data_schema * or * BigQuerySource.data_schema google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. */ // const autoGenerateIds = true /** diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json index eaaf985c074..8761c9f24cb 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 91, + "end": 93, "type": "FULL" } ], @@ -898,7 +898,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 72, "type": "FULL" } ], diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js b/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js index 085981bc87b..536d06ef174 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js @@ -20,7 +20,7 @@ 'use strict'; -function main(inlineSource, gcsSource, bigquerySource, parent) { +function main(parent) { // [START discoveryengine_v1beta_generated_UserEventService_ImportUserEvents_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -29,15 +29,15 @@ function main(inlineSource, gcsSource, bigquerySource, parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The Inline source for the input content for UserEvents. + * The Inline source for the input content for UserEvents. */ // const inlineSource = {} /** - * Required. Cloud Storage location for the input content. + * Cloud Storage location for the input content. */ // const gcsSource = {} /** - * Required. BigQuery input source. + * BigQuery input source. */ // const bigquerySource = {} /** @@ -60,9 +60,6 @@ function main(inlineSource, gcsSource, bigquerySource, parent) { async function callImportUserEvents() { // Construct request const request = { - inlineSource, - gcsSource, - bigquerySource, parent, }; diff --git a/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts index 433e2409707..d643e9ae9a5 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts @@ -356,6 +356,8 @@ export class CompletionServiceClient { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * diff --git a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts index f5bf6a7e05d..754fd0ac8bd 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts @@ -955,7 +955,7 @@ export class DocumentServiceClient { * {@link google.cloud.discoveryengine.v1beta.GcsSource.data_schema|GcsSource.data_schema} * or * {@link google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema|BigQuerySource.data_schema} - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * @param {string} request.idField * The field in the Cloud Storage and BigQuery sources that indicates the * unique IDs of the documents. diff --git a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts index 15040d8bce6..bafb3682d08 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts @@ -657,11 +657,11 @@ export class UserEventServiceClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.discoveryengine.v1beta.ImportUserEventsRequest.InlineSource} request.inlineSource - * Required. The Inline source for the input content for UserEvents. + * The Inline source for the input content for UserEvents. * @param {google.cloud.discoveryengine.v1beta.GcsSource} request.gcsSource - * Required. Cloud Storage location for the input content. + * Cloud Storage location for the input content. * @param {google.cloud.discoveryengine.v1beta.BigQuerySource} request.bigquerySource - * Required. BigQuery input source. + * BigQuery input source. * @param {string} request.parent * Required. Parent DataStore resource name, of the form * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`