serving_config.proto 12 KB

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