diff --git a/api_names_out.yaml b/api_names_out.yaml index 88c83e32632..bae258d0c71 100644 --- a/api_names_out.yaml +++ b/api_names_out.yaml @@ -324744,6 +324744,57 @@ "/retail:v2/GoogleCloudRetailV2ConversationalSearchCustomizationConfig/catalog": catalog "/retail:v2/GoogleCloudRetailV2ConversationalSearchCustomizationConfig/intentClassificationConfig": intent_classification_config "/retail:v2/GoogleCloudRetailV2ConversationalSearchCustomizationConfig/retailerDisplayName": retailer_display_name +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest": google_cloud_retail_v2_conversational_search_request +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/branch": branch +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/conversationId": conversation_id +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/conversationalFilteringSpec": conversational_filtering_spec +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/pageCategories": page_categories +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/pageCategories/page_category": page_category +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/query": query +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/safetySettings": safety_settings +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/safetySettings/safety_setting": safety_setting +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/searchParams": search_params +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/userInfo": user_info +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/userLabels": user_labels +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/userLabels/user_label": user_label +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequest/visitorId": visitor_id +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec": google_cloud_retail_v2_conversational_search_request_conversational_filtering_spec +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec/conversationalFilteringMode": conversational_filtering_mode +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec/enableConversationalFiltering": enable_conversational_filtering +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec/userAnswer": user_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestSearchParams": google_cloud_retail_v2_conversational_search_request_search_params +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestSearchParams/boostSpec": boost_spec +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestSearchParams/canonicalFilter": canonical_filter +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestSearchParams/filter": filter +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestSearchParams/sortBy": sort_by +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestUserAnswer": google_cloud_retail_v2_conversational_search_request_user_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestUserAnswer/selectedAnswer": selected_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestUserAnswer/textAnswer": text_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer": google_cloud_retail_v2_conversational_search_request_user_answer_selected_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer/productAttributeValue": product_attribute_value +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse": google_cloud_retail_v2_conversational_search_response +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/conversationId": conversation_id +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/conversationalFilteringResult": conversational_filtering_result +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/conversationalTextResponse": conversational_text_response +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/followupQuestion": followup_question +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/refinedSearch": refined_search +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/refinedSearch/refined_search": refined_search +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/state": state +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/userQueryTypes": user_query_types +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponse/userQueryTypes/user_query_type": user_query_type +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult": google_cloud_retail_v2_conversational_search_response_conversational_filtering_result +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult/additionalFilter": additional_filter +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult/followupQuestion": followup_question +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter": google_cloud_retail_v2_conversational_search_response_conversational_filtering_result_additional_filter +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter/productAttributeValue": product_attribute_value +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion": google_cloud_retail_v2_conversational_search_response_followup_question +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion/followupQuestion": followup_question +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion/suggestedAnswers": suggested_answers +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion/suggestedAnswers/suggested_answer": suggested_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer": google_cloud_retail_v2_conversational_search_response_followup_question_suggested_answer +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer/productAttributeValue": product_attribute_value +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch": google_cloud_retail_v2_conversational_search_response_refined_search +"/retail:v2/GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch/query": query "/retail:v2/GoogleCloudRetailV2CreateModelMetadata": google_cloud_retail_v2_create_model_metadata "/retail:v2/GoogleCloudRetailV2CreateModelMetadata/model": model "/retail:v2/GoogleCloudRetailV2CustomAttribute": google_cloud_retail_v2_custom_attribute @@ -325169,6 +325220,10 @@ "/retail:v2/GoogleCloudRetailV2RuleTwowaySynonymsAction": google_cloud_retail_v2_rule_twoway_synonyms_action "/retail:v2/GoogleCloudRetailV2RuleTwowaySynonymsAction/synonyms": synonyms "/retail:v2/GoogleCloudRetailV2RuleTwowaySynonymsAction/synonyms/synonym": synonym +"/retail:v2/GoogleCloudRetailV2SafetySetting": google_cloud_retail_v2_safety_setting +"/retail:v2/GoogleCloudRetailV2SafetySetting/category": category +"/retail:v2/GoogleCloudRetailV2SafetySetting/method": method_prop +"/retail:v2/GoogleCloudRetailV2SafetySetting/threshold": threshold "/retail:v2/GoogleCloudRetailV2SearchRequest": google_cloud_retail_v2_search_request "/retail:v2/GoogleCloudRetailV2SearchRequest/banner": banner "/retail:v2/GoogleCloudRetailV2SearchRequest/boostSpec": boost_spec @@ -325878,12 +325933,16 @@ "/retail:v2/retail.projects.locations.catalogs.patch": patch_project_location_catalog "/retail:v2/retail.projects.locations.catalogs.patch/name": name "/retail:v2/retail.projects.locations.catalogs.patch/updateMask": update_mask +"/retail:v2/retail.projects.locations.catalogs.placements.conversationalSearch": conversational_project_location_catalog_placement_search +"/retail:v2/retail.projects.locations.catalogs.placements.conversationalSearch/placement": placement "/retail:v2/retail.projects.locations.catalogs.placements.predict": predict_project_location_catalog_placement "/retail:v2/retail.projects.locations.catalogs.placements.predict/placement": placement "/retail:v2/retail.projects.locations.catalogs.placements.search": search_project_location_catalog_placements "/retail:v2/retail.projects.locations.catalogs.placements.search/placement": placement "/retail:v2/retail.projects.locations.catalogs.servingConfigs.addControl": add_project_location_catalog_serving_config_control "/retail:v2/retail.projects.locations.catalogs.servingConfigs.addControl/servingConfig": serving_config +"/retail:v2/retail.projects.locations.catalogs.servingConfigs.conversationalSearch": conversational_project_location_catalog_serving_config_search +"/retail:v2/retail.projects.locations.catalogs.servingConfigs.conversationalSearch/placement": placement "/retail:v2/retail.projects.locations.catalogs.servingConfigs.create": create_project_location_catalog_serving_config "/retail:v2/retail.projects.locations.catalogs.servingConfigs.create/parent": parent "/retail:v2/retail.projects.locations.catalogs.servingConfigs.create/servingConfigId": serving_config_id diff --git a/generated/google-apis-retail_v2/CHANGELOG.md b/generated/google-apis-retail_v2/CHANGELOG.md index abe0c2312e2..f40221cad47 100644 --- a/generated/google-apis-retail_v2/CHANGELOG.md +++ b/generated/google-apis-retail_v2/CHANGELOG.md @@ -1,5 +1,9 @@ # Release history for google-apis-retail_v2 +### v0.122.0 (2025-09-21) + +* Regenerated from discovery document revision 20250911 + ### v0.121.0 (2025-07-27) * Regenerated from discovery document revision 20250717 diff --git a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/classes.rb b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/classes.rb index ee239a663aa..d9f3a49c19a 100644 --- a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/classes.rb +++ b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/classes.rb @@ -1587,6 +1587,414 @@ def update!(**args) end end + # Request message for ConversationalSearchService.ConversationalSearch method. + class GoogleCloudRetailV2ConversationalSearchRequest + include Google::Apis::Core::Hashable + + # Required. The branch resource name, such as `projects/*/locations/global/ + # catalogs/default_catalog/branches/0`. Use "default_branch" as the branch ID or + # leave this field empty, to search products under the default branch. + # Corresponds to the JSON property `branch` + # @return [String] + attr_accessor :branch + + # Optional. This field specifies the conversation id, which maintains the state + # of the conversation between client side and server side. Use the value from + # the previous ConversationalSearchResponse.conversation_id. For the initial + # request, this should be empty. + # Corresponds to the JSON property `conversationId` + # @return [String] + attr_accessor :conversation_id + + # This field specifies all conversational filtering related parameters addition + # to conversational retail search. + # Corresponds to the JSON property `conversationalFilteringSpec` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec] + attr_accessor :conversational_filtering_spec + + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format should + # be the same as UserEvent.page_categories; To represent full path of category, + # use '>' sign to separate different hierarchies. If '>' is part of the category + # name, replace it with other character(s). Category pages include special pages + # such as sales or promotions. For instance, a special sale page may have the + # category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # Corresponds to the JSON property `pageCategories` + # @return [Array] + attr_accessor :page_categories + + # Optional. Raw search query to be searched for. If this field is empty, the + # request is considered a category browsing request. + # Corresponds to the JSON property `query` + # @return [String] + attr_accessor :query + + # Optional. The safety settings to be applied to the generated content. + # Corresponds to the JSON property `safetySettings` + # @return [Array] + attr_accessor :safety_settings + + # Search parameters. + # Corresponds to the JSON property `searchParams` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestSearchParams] + attr_accessor :search_params + + # Information of an end user. + # Corresponds to the JSON property `userInfo` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2UserInfo] + attr_accessor :user_info + + # Optional. The user labels applied to a resource must meet the following + # requirements: * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. * Keys have a minimum length of 1 + # character and a maximum length of 63 characters and cannot be empty. Values + # can be empty and have a maximum length of 63 characters. * Keys and values can + # contain only lowercase letters, numeric characters, underscores, and dashes. + # All characters must use UTF-8 encoding, and international characters are + # allowed. * The key portion of a label must be unique. However, you can use the + # same key with multiple resources. * Keys must start with a lowercase letter or + # international character. See [Google Cloud Document](https://cloud.google.com/ + # resource-manager/docs/creating-managing-labels#requirements) for more details. + # Corresponds to the JSON property `userLabels` + # @return [Hash] + attr_accessor :user_labels + + # Required. A unique identifier for tracking visitors. For example, this could + # be implemented with an HTTP cookie, which should be able to uniquely identify + # a visitor on a single device. This unique identifier should not change if the + # visitor logs in or out of the website. This should be the same identifier as + # UserEvent.visitor_id. The field must be a UTF-8 encoded string with a length + # limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. + # Corresponds to the JSON property `visitorId` + # @return [String] + attr_accessor :visitor_id + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @branch = args[:branch] if args.key?(:branch) + @conversation_id = args[:conversation_id] if args.key?(:conversation_id) + @conversational_filtering_spec = args[:conversational_filtering_spec] if args.key?(:conversational_filtering_spec) + @page_categories = args[:page_categories] if args.key?(:page_categories) + @query = args[:query] if args.key?(:query) + @safety_settings = args[:safety_settings] if args.key?(:safety_settings) + @search_params = args[:search_params] if args.key?(:search_params) + @user_info = args[:user_info] if args.key?(:user_info) + @user_labels = args[:user_labels] if args.key?(:user_labels) + @visitor_id = args[:visitor_id] if args.key?(:visitor_id) + end + end + + # This field specifies all conversational filtering related parameters addition + # to conversational retail search. + class GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec + include Google::Apis::Core::Hashable + + # Optional. Mode to control Conversational Filtering. Defaults to Mode.DISABLED + # if it's unset. + # Corresponds to the JSON property `conversationalFilteringMode` + # @return [String] + attr_accessor :conversational_filtering_mode + + # Optional. This field is deprecated. Please use ConversationalFilteringSpec. + # conversational_filtering_mode instead. + # Corresponds to the JSON property `enableConversationalFiltering` + # @return [Boolean] + attr_accessor :enable_conversational_filtering + alias_method :enable_conversational_filtering?, :enable_conversational_filtering + + # This field specifies the current user answer during the conversational + # filtering search. This can be either user selected from suggested answers or + # user input plain text. + # Corresponds to the JSON property `userAnswer` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswer] + attr_accessor :user_answer + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @conversational_filtering_mode = args[:conversational_filtering_mode] if args.key?(:conversational_filtering_mode) + @enable_conversational_filtering = args[:enable_conversational_filtering] if args.key?(:enable_conversational_filtering) + @user_answer = args[:user_answer] if args.key?(:user_answer) + end + end + + # Search parameters. + class GoogleCloudRetailV2ConversationalSearchRequestSearchParams + include Google::Apis::Core::Hashable + + # Boost specification to boost certain items. + # Corresponds to the JSON property `boostSpec` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2SearchRequestBoostSpec] + attr_accessor :boost_spec + + # Optional. The canonical filter string to restrict search results. The syntax + # of the canonical filter string is the same as SearchRequest.canonical_filter. + # Corresponds to the JSON property `canonicalFilter` + # @return [String] + attr_accessor :canonical_filter + + # Optional. The filter string to restrict search results. The syntax of the + # filter string is the same as SearchRequest.filter. + # Corresponds to the JSON property `filter` + # @return [String] + attr_accessor :filter + + # Optional. The sort string to specify the sorting of search results. The syntax + # of the sort string is the same as SearchRequest.sort. + # Corresponds to the JSON property `sortBy` + # @return [String] + attr_accessor :sort_by + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @boost_spec = args[:boost_spec] if args.key?(:boost_spec) + @canonical_filter = args[:canonical_filter] if args.key?(:canonical_filter) + @filter = args[:filter] if args.key?(:filter) + @sort_by = args[:sort_by] if args.key?(:sort_by) + end + end + + # This field specifies the current user answer during the conversational + # filtering search. This can be either user selected from suggested answers or + # user input plain text. + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswer + include Google::Apis::Core::Hashable + + # This field specifies the selected answers during the conversational search. + # Corresponds to the JSON property `selectedAnswer` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer] + attr_accessor :selected_answer + + # This field specifies the incremental input text from the user during the + # conversational search. + # Corresponds to the JSON property `textAnswer` + # @return [String] + attr_accessor :text_answer + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @selected_answer = args[:selected_answer] if args.key?(:selected_answer) + @text_answer = args[:text_answer] if args.key?(:text_answer) + end + end + + # This field specifies the selected answers during the conversational search. + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer + include Google::Apis::Core::Hashable + + # Product attribute which structured by an attribute name and value. This + # structure is used in conversational search filters and answers. For example, + # if we have `name=color` and `value=red`, this means that the color is `red`. + # Corresponds to the JSON property `productAttributeValue` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue] + attr_accessor :product_attribute_value + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @product_attribute_value = args[:product_attribute_value] if args.key?(:product_attribute_value) + end + end + + # Response message for ConversationalSearchService.ConversationalSearch method. + class GoogleCloudRetailV2ConversationalSearchResponse + include Google::Apis::Core::Hashable + + # Conversation UUID. This field will be stored in client side storage to + # maintain the conversation session with server and will be used for next search + # request's ConversationalSearchRequest.conversation_id to restore conversation + # state in server. + # Corresponds to the JSON property `conversationId` + # @return [String] + attr_accessor :conversation_id + + # This field specifies all related information that is needed on client side for + # UI rendering of conversational filtering search. + # Corresponds to the JSON property `conversationalFilteringResult` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult] + attr_accessor :conversational_filtering_result + + # The conversational answer-based text response generated by the Server. + # Corresponds to the JSON property `conversationalTextResponse` + # @return [String] + attr_accessor :conversational_text_response + + # The conversational followup question generated for Intent refinement. + # Corresponds to the JSON property `followupQuestion` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion] + attr_accessor :followup_question + + # The proposed refined search queries. They can be used to fetch the relevant + # search results. When using CONVERSATIONAL_FILTER_ONLY mode, the refined_query + # from search response will be populated here. + # Corresponds to the JSON property `refinedSearch` + # @return [Array] + attr_accessor :refined_search + + # Output only. The state of the response generation. + # Corresponds to the JSON property `state` + # @return [String] + attr_accessor :state + + # The types Retail classifies the search query as. Supported values are: - " + # ORDER_SUPPORT" - "SIMPLE_PRODUCT_SEARCH" - "INTENT_REFINEMENT" - " + # PRODUCT_DETAILS" - "PRODUCT_COMPARISON" - "DEALS_AND_COUPONS" - " + # STORE_RELEVANT" - "BLOCKLISTED" - "BEST_PRODUCT" - "RETAIL_SUPPORT" - " + # DISABLED" + # Corresponds to the JSON property `userQueryTypes` + # @return [Array] + attr_accessor :user_query_types + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @conversation_id = args[:conversation_id] if args.key?(:conversation_id) + @conversational_filtering_result = args[:conversational_filtering_result] if args.key?(:conversational_filtering_result) + @conversational_text_response = args[:conversational_text_response] if args.key?(:conversational_text_response) + @followup_question = args[:followup_question] if args.key?(:followup_question) + @refined_search = args[:refined_search] if args.key?(:refined_search) + @state = args[:state] if args.key?(:state) + @user_query_types = args[:user_query_types] if args.key?(:user_query_types) + end + end + + # This field specifies all related information that is needed on client side for + # UI rendering of conversational filtering search. + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult + include Google::Apis::Core::Hashable + + # Additional filter that client side need to apply. + # Corresponds to the JSON property `additionalFilter` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter] + attr_accessor :additional_filter + + # The conversational followup question generated for Intent refinement. + # Corresponds to the JSON property `followupQuestion` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion] + attr_accessor :followup_question + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @additional_filter = args[:additional_filter] if args.key?(:additional_filter) + @followup_question = args[:followup_question] if args.key?(:followup_question) + end + end + + # Additional filter that client side need to apply. + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter + include Google::Apis::Core::Hashable + + # Product attribute which structured by an attribute name and value. This + # structure is used in conversational search filters and answers. For example, + # if we have `name=color` and `value=red`, this means that the color is `red`. + # Corresponds to the JSON property `productAttributeValue` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue] + attr_accessor :product_attribute_value + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @product_attribute_value = args[:product_attribute_value] if args.key?(:product_attribute_value) + end + end + + # The conversational followup question generated for Intent refinement. + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion + include Google::Apis::Core::Hashable + + # The conversational followup question generated for Intent refinement. + # Corresponds to the JSON property `followupQuestion` + # @return [String] + attr_accessor :followup_question + + # The answer options provided to client for the follow-up question. + # Corresponds to the JSON property `suggestedAnswers` + # @return [Array] + attr_accessor :suggested_answers + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @followup_question = args[:followup_question] if args.key?(:followup_question) + @suggested_answers = args[:suggested_answers] if args.key?(:suggested_answers) + end + end + + # Suggested answers to the follow-up question. If it's numerical attribute, only + # ProductAttributeInterval will be set. If it's textual attribute, only + # productAttributeValue will be set. + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer + include Google::Apis::Core::Hashable + + # Product attribute which structured by an attribute name and value. This + # structure is used in conversational search filters and answers. For example, + # if we have `name=color` and `value=red`, this means that the color is `red`. + # Corresponds to the JSON property `productAttributeValue` + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue] + attr_accessor :product_attribute_value + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @product_attribute_value = args[:product_attribute_value] if args.key?(:product_attribute_value) + end + end + + # The proposed refined search for intent-refinement/bundled shopping + # conversation. When using CONVERSATIONAL_FILTER_ONLY mode, the refined_query + # from search response will be populated here. + class GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch + include Google::Apis::Core::Hashable + + # The query to be used for search. + # Corresponds to the JSON property `query` + # @return [String] + attr_accessor :query + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @query = args[:query] if args.key?(:query) + end + end + # Metadata associated with a create operation. class GoogleCloudRetailV2CreateModelMetadata include Google::Apis::Core::Hashable @@ -5112,6 +5520,38 @@ def update!(**args) end end + # Safety settings. + class GoogleCloudRetailV2SafetySetting + include Google::Apis::Core::Hashable + + # Harm category. + # Corresponds to the JSON property `category` + # @return [String] + attr_accessor :category + + # Optional. Specify if the threshold is used for probability or severity score. + # If not specified, the threshold is used for probability score. + # Corresponds to the JSON property `method` + # @return [String] + attr_accessor :method_prop + + # The harm block threshold. + # Corresponds to the JSON property `threshold` + # @return [String] + attr_accessor :threshold + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @category = args[:category] if args.key?(:category) + @method_prop = args[:method_prop] if args.key?(:method_prop) + @threshold = args[:threshold] if args.key?(:threshold) + end + end + # Request message for SearchService.Search method. class GoogleCloudRetailV2SearchRequest include Google::Apis::Core::Hashable diff --git a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/gem_version.rb b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/gem_version.rb index 82eb6a821af..9f77bab55bc 100644 --- a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/gem_version.rb +++ b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/gem_version.rb @@ -16,13 +16,13 @@ module Google module Apis module RetailV2 # Version of the google-apis-retail_v2 gem - GEM_VERSION = "0.121.0" + GEM_VERSION = "0.122.0" # Version of the code generator used to generate this client GENERATOR_VERSION = "0.18.0" # Revision of the discovery document this client was generated from - REVISION = "20250717" + REVISION = "20250911" end end end diff --git a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/representations.rb b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/representations.rb index ee95f366c87..b6c00b7c86f 100644 --- a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/representations.rb +++ b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/representations.rb @@ -274,6 +274,72 @@ class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end + class GoogleCloudRetailV2ConversationalSearchRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchRequestSearchParams + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswer + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponse + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class GoogleCloudRetailV2CreateModelMetadata class Representation < Google::Apis::Core::JsonRepresentation; end @@ -844,6 +910,12 @@ class Representation < Google::Apis::Core::JsonRepresentation; end include Google::Apis::Core::JsonObjectSupport end + class GoogleCloudRetailV2SafetySetting + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class GoogleCloudRetailV2SearchRequest class Representation < Google::Apis::Core::JsonRepresentation; end @@ -2000,6 +2072,122 @@ class Representation < Google::Apis::Core::JsonRepresentation end end + class GoogleCloudRetailV2ConversationalSearchRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :branch, as: 'branch' + property :conversation_id, as: 'conversationId' + property :conversational_filtering_spec, as: 'conversationalFilteringSpec', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec::Representation + + collection :page_categories, as: 'pageCategories' + property :query, as: 'query' + collection :safety_settings, as: 'safetySettings', class: Google::Apis::RetailV2::GoogleCloudRetailV2SafetySetting, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2SafetySetting::Representation + + property :search_params, as: 'searchParams', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestSearchParams, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestSearchParams::Representation + + property :user_info, as: 'userInfo', class: Google::Apis::RetailV2::GoogleCloudRetailV2UserInfo, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2UserInfo::Representation + + hash :user_labels, as: 'userLabels' + property :visitor_id, as: 'visitorId' + end + end + + class GoogleCloudRetailV2ConversationalSearchRequestConversationalFilteringSpec + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :conversational_filtering_mode, as: 'conversationalFilteringMode' + property :enable_conversational_filtering, as: 'enableConversationalFiltering' + property :user_answer, as: 'userAnswer', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswer, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswer::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchRequestSearchParams + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :boost_spec, as: 'boostSpec', class: Google::Apis::RetailV2::GoogleCloudRetailV2SearchRequestBoostSpec, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2SearchRequestBoostSpec::Representation + + property :canonical_filter, as: 'canonicalFilter' + property :filter, as: 'filter' + property :sort_by, as: 'sortBy' + end + end + + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswer + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :selected_answer, as: 'selectedAnswer', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer::Representation + + property :text_answer, as: 'textAnswer' + end + end + + class GoogleCloudRetailV2ConversationalSearchRequestUserAnswerSelectedAnswer + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :product_attribute_value, as: 'productAttributeValue', class: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchResponse + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :conversation_id, as: 'conversationId' + property :conversational_filtering_result, as: 'conversationalFilteringResult', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult::Representation + + property :conversational_text_response, as: 'conversationalTextResponse' + property :followup_question, as: 'followupQuestion', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion::Representation + + collection :refined_search, as: 'refinedSearch', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch::Representation + + property :state, as: 'state' + collection :user_query_types, as: 'userQueryTypes' + end + end + + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResult + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :additional_filter, as: 'additionalFilter', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter::Representation + + property :followup_question, as: 'followupQuestion', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchResponseConversationalFilteringResultAdditionalFilter + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :product_attribute_value, as: 'productAttributeValue', class: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestion + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :followup_question, as: 'followupQuestion' + collection :suggested_answers, as: 'suggestedAnswers', class: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchResponseFollowupQuestionSuggestedAnswer + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :product_attribute_value, as: 'productAttributeValue', class: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue, decorator: Google::Apis::RetailV2::GoogleCloudRetailV2ProductAttributeValue::Representation + + end + end + + class GoogleCloudRetailV2ConversationalSearchResponseRefinedSearch + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :query, as: 'query' + end + end + class GoogleCloudRetailV2CreateModelMetadata # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -2904,6 +3092,15 @@ class Representation < Google::Apis::Core::JsonRepresentation end end + class GoogleCloudRetailV2SafetySetting + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :category, as: 'category' + property :method_prop, as: 'method' + property :threshold, as: 'threshold' + end + end + class GoogleCloudRetailV2SearchRequest # @private class Representation < Google::Apis::Core::JsonRepresentation diff --git a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/service.rb b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/service.rb index fd0b5ef42cf..5f1827eaf51 100644 --- a/generated/google-apis-retail_v2/lib/google/apis/retail_v2/service.rb +++ b/generated/google-apis-retail_v2/lib/google/apis/retail_v2/service.rb @@ -2012,6 +2012,44 @@ def list_project_location_catalog_operations(name, filter: nil, page_size: nil, execute_or_queue_command(command, &block) end + # Performs a conversational search. This feature is only available for users who + # have Conversational Search enabled. + # @param [String] placement + # Required. The resource name of the search engine placement, such as `projects/* + # /locations/global/catalogs/default_catalog/placements/default_search` or ` + # projects/*/locations/global/catalogs/default_catalog/servingConfigs/ + # default_serving_config` This field is used to identify the serving config name + # and the set of models that will be used to make the search. + # @param [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequest] google_cloud_retail_v2_conversational_search_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def conversational_project_location_catalog_placement_search(placement, google_cloud_retail_v2_conversational_search_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+placement}:conversationalSearch', options) + command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequest::Representation + command.request_object = google_cloud_retail_v2_conversational_search_request_object + command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse::Representation + command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse + command.params['placement'] = placement unless placement.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + # Makes a recommendation prediction. # @param [String] placement # Required. Full resource name of the format: ``placement=projects/*/locations/ @@ -2134,6 +2172,44 @@ def add_project_location_catalog_serving_config_control(serving_config, google_c execute_or_queue_command(command, &block) end + # Performs a conversational search. This feature is only available for users who + # have Conversational Search enabled. + # @param [String] placement + # Required. The resource name of the search engine placement, such as `projects/* + # /locations/global/catalogs/default_catalog/placements/default_search` or ` + # projects/*/locations/global/catalogs/default_catalog/servingConfigs/ + # default_serving_config` This field is used to identify the serving config name + # and the set of models that will be used to make the search. + # @param [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequest] google_cloud_retail_v2_conversational_search_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def conversational_project_location_catalog_serving_config_search(placement, google_cloud_retail_v2_conversational_search_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+placement}:conversationalSearch', options) + command.request_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchRequest::Representation + command.request_object = google_cloud_retail_v2_conversational_search_request_object + command.response_representation = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse::Representation + command.response_class = Google::Apis::RetailV2::GoogleCloudRetailV2ConversationalSearchResponse + command.params['placement'] = placement unless placement.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + # Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a # Catalog, otherwise a FAILED_PRECONDITION error is returned. # @param [String] parent