serving_config.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.retail.v2;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/retail/v2/common.proto";
  19. import "google/cloud/retail/v2/search_service.proto";
  20. option csharp_namespace = "Google.Cloud.Retail.V2";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ServingConfigProto";
  24. option java_package = "com.google.cloud.retail.v2";
  25. option objc_class_prefix = "RETAIL";
  26. option php_namespace = "Google\\Cloud\\Retail\\V2";
  27. option ruby_package = "Google::Cloud::Retail::V2";
  28. // Configures metadata that is used to generate serving time results (e.g.
  29. // search results or recommendation predictions).
  30. message ServingConfig {
  31. option (google.api.resource) = {
  32. type: "retail.googleapis.com/ServingConfig"
  33. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}"
  34. };
  35. // Immutable. Fully qualified name
  36. // `projects/*/locations/global/catalogs/*/servingConfig/*`
  37. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  38. // Required. The human readable serving config display name. Used in Retail
  39. // UI.
  40. //
  41. // This field must be a UTF-8 encoded string with a length limit of 128
  42. // characters. Otherwise, an INVALID_ARGUMENT error is returned.
  43. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  44. // The id of the model in the same [Catalog][google.cloud.retail.v2.Catalog]
  45. // to use at serving time. Currently only RecommendationModels are supported:
  46. // https://cloud.google.com/retail/recommendations-ai/docs/create-models
  47. // Can be changed but only to a compatible model (e.g.
  48. // others-you-may-like CTR to others-you-may-like CVR).
  49. //
  50. // Required when
  51. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  52. // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
  53. string model_id = 3;
  54. // How much price ranking we want in serving results.
  55. // Price reranking causes product items with a similar
  56. // recommendation probability to be ordered by price, with the
  57. // highest-priced items first. This setting could result in a decrease in
  58. // click-through and conversion rates.
  59. // Allowed values are:
  60. //
  61. // * 'no-price-reranking'
  62. // * 'low-price-raranking'
  63. // * 'medium-price-reranking'
  64. // * 'high-price-reranking'
  65. //
  66. // If not specified, we choose default based on model type. Default value:
  67. // 'no-price-reranking'.
  68. //
  69. // Can only be set if
  70. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  71. // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
  72. string price_reranking_level = 4;
  73. // Facet specifications for faceted search. If empty, no facets are returned.
  74. // The ids refer to the ids of [Control][google.cloud.retail.v2.Control]
  75. // resources with only the Facet control set. These controls are assumed to be
  76. // in the same [Catalog][google.cloud.retail.v2.Catalog] as the
  77. // [ServingConfig][google.cloud.retail.v2.ServingConfig].
  78. // A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
  79. // is returned.
  80. //
  81. // Can only be set if
  82. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  83. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  84. repeated string facet_control_ids = 5;
  85. // The specification for dynamically generated facets. Notice that only
  86. // textual facets can be dynamically generated.
  87. //
  88. // Can only be set if
  89. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  90. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  91. SearchRequest.DynamicFacetSpec dynamic_facet_spec = 6;
  92. // Condition boost specifications. If a product matches multiple conditions
  93. // in the specifications, boost scores from these specifications are all
  94. // applied and combined in a non-linear way. Maximum number of
  95. // specifications is 100.
  96. //
  97. // Notice that if both
  98. // [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids]
  99. // and
  100. // [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
  101. // are set, the boost conditions from both places are evaluated. If a search
  102. // request matches multiple boost conditions, the final boost score is equal
  103. // to the sum of the boost scores from all matched boost conditions.
  104. //
  105. // Can only be set if
  106. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  107. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  108. repeated string boost_control_ids = 7;
  109. // Condition filter specifications. If a product matches multiple conditions
  110. // in the specifications, filters from these specifications are all
  111. // applied and combined via the AND operator. Maximum number of
  112. // specifications is 100.
  113. //
  114. // Can only be set if
  115. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  116. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  117. repeated string filter_control_ids = 9;
  118. // Condition redirect specifications. Only the first triggered redirect action
  119. // is applied, even if multiple apply. Maximum number of specifications is
  120. // 1000.
  121. //
  122. // Can only be set if
  123. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  124. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  125. repeated string redirect_control_ids = 10;
  126. // Condition synonyms specifications. If multiple syonyms conditions match,
  127. // all matching synonyms control in the list will execute. Order of controls
  128. // in the list will not matter. Maximum number of specifications is
  129. // 100.
  130. //
  131. // Can only be set if
  132. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  133. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  134. repeated string twoway_synonyms_control_ids = 18;
  135. // Condition oneway synonyms specifications. If multiple oneway synonyms
  136. // conditions match, all matching oneway synonyms controls in the list will
  137. // execute. Order of controls in the list will not matter. Maximum number of
  138. // specifications is 100.
  139. //
  140. // Can only be set if
  141. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  142. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  143. repeated string oneway_synonyms_control_ids = 12;
  144. // Condition do not associate specifications. If multiple do not associate
  145. // conditions match, all matching do not associate controls in the list will
  146. // execute.
  147. // - Order does not matter.
  148. // - Maximum number of specifications is 100.
  149. //
  150. // Can only be set if
  151. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  152. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  153. repeated string do_not_associate_control_ids = 13;
  154. // Condition replacement specifications.
  155. // - Applied according to the order in the list.
  156. // - A previously replaced term can not be re-replaced.
  157. // - Maximum number of specifications is 100.
  158. //
  159. // Can only be set if
  160. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  161. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  162. repeated string replacement_control_ids = 14;
  163. // Condition ignore specifications. If multiple ignore
  164. // conditions match, all matching ignore controls in the list will
  165. // execute.
  166. // - Order does not matter.
  167. // - Maximum number of specifications is 100.
  168. //
  169. // Can only be set if
  170. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  171. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  172. repeated string ignore_control_ids = 15;
  173. // How much diversity to use in recommendation model results e.g.
  174. // 'medium-diversity' or 'high-diversity'. Currently supported values:
  175. //
  176. // * 'no-diversity'
  177. // * 'low-diversity'
  178. // * 'medium-diversity'
  179. // * 'high-diversity'
  180. // * 'auto-diversity'
  181. //
  182. // If not specified, we choose default based on recommendation model
  183. // type. Default value: 'no-diversity'.
  184. //
  185. // Can only be set if
  186. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  187. // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
  188. string diversity_level = 8;
  189. // Whether to add additional category filters on the 'similar-items' model.
  190. // If not specified, we enable it by default.
  191. // Allowed values are:
  192. //
  193. // * 'no-category-match': No additional filtering of original results from
  194. // the model and the customer's filters.
  195. // * 'relaxed-category-match': Only keep results with categories that match
  196. // at least one item categories in the PredictRequests's context item.
  197. // * If customer also sends filters in the PredictRequest, then the results
  198. // will satisfy both conditions (user given and category match).
  199. //
  200. // Can only be set if
  201. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  202. // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
  203. string enable_category_filter_level = 16;
  204. // The specification for personalization spec.
  205. //
  206. // Can only be set if
  207. // [solution_types][google.cloud.retail.v2.ServingConfig.solution_types] is
  208. // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
  209. //
  210. // Notice that if both
  211. // [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec]
  212. // and
  213. // [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
  214. // are set.
  215. // [SearchRequest.personalization_spec][google.cloud.retail.v2.SearchRequest.personalization_spec]
  216. // will override
  217. // [ServingConfig.personalization_spec][google.cloud.retail.v2.ServingConfig.personalization_spec].
  218. SearchRequest.PersonalizationSpec personalization_spec = 21;
  219. // Required. Immutable. Specifies the solution types that a serving config can
  220. // be associated with. Currently we support setting only one type of solution.
  221. repeated SolutionType solution_types = 19 [
  222. (google.api.field_behavior) = REQUIRED,
  223. (google.api.field_behavior) = IMMUTABLE
  224. ];
  225. }