Debian Codegraph @

docs/dyn/retail_v2alpha.projects.locations.catalogs.models.html

raw
1 <html><body>
2 <style>
3
4 body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13 }
14
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51 }
52
53 .toc_element {
54 margin-top: 0.5em;
55 }
56
57 .firstline {
58 margin-left: 2 em;
59 }
60
61 .method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66 }
67
68 .details {
69 font-weight: bold;
70 font-size: 14px;
71 }
72
73 </style>
74
75 <h1><a href="retail_v2alpha.html">Vertex AI Search for commerce API</a> . <a href="retail_v2alpha.projects.html">projects</a> . <a href="retail_v2alpha.projects.locations.html">locations</a> . <a href="retail_v2alpha.projects.locations.catalogs.html">catalogs</a> . <a href="retail_v2alpha.projects.locations.catalogs.models.html">models</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#close">close()</a></code></p>
79 <p class="firstline">Close httplib2 connections.</p>
80 <p class="toc_element">
81 <code><a href="#create">create(parent, body=None, dryRun=None, x__xgafv=None)</a></code></p>
82 <p class="firstline">Creates a new model.</p>
83 <p class="toc_element">
84 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
85 <p class="firstline">Deletes an existing model.</p>
86 <p class="toc_element">
87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
88 <p class="firstline">Gets a model.</p>
89 <p class="toc_element">
90 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
91 <p class="firstline">Lists all the models linked to this event store.</p>
92 <p class="toc_element">
93 <code><a href="#list_next">list_next()</a></code></p>
94 <p class="firstline">Retrieves the next page of results.</p>
95 <p class="toc_element">
96 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
97 <p class="firstline">Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.</p>
98 <p class="toc_element">
99 <code><a href="#pause">pause(name, body=None, x__xgafv=None)</a></code></p>
100 <p class="firstline">Pauses the training of an existing model.</p>
101 <p class="toc_element">
102 <code><a href="#resume">resume(name, body=None, x__xgafv=None)</a></code></p>
103 <p class="firstline">Resumes the training of an existing model.</p>
104 <p class="toc_element">
105 <code><a href="#tune">tune(name, body=None, x__xgafv=None)</a></code></p>
106 <p class="firstline">Tunes an existing model.</p>
107 <h3>Method Details</h3>
108 <div class="method">
109 <code class="details" id="close">close()</code>
110 <pre>Close httplib2 connections.</pre>
111 </div>
112
113 <div class="method">
114 <code class="details" id="create">create(parent, body=None, dryRun=None, x__xgafv=None)</code>
115 <pre>Creates a new model.
116
117 Args:
118 parent: string, Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` (required)
119 body: object, The request body.
120 The object takes the form of:
121
122 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
123 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
124 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
125 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
126 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
127 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
128 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
129 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
130 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
131 },
132 },
133 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
134 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
135 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
136 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
137 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
138 { # An individual panel with a list of ServingConfigs to consider for it.
139 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
140 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
141 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
142 },
143 ],
144 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
145 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
146 },
147 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
148 },
149 ],
150 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
151 },
152 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
153 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
154 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
155 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
156 &quot;A String&quot;,
157 ],
158 },
159 ],
160 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
161 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
162 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
163 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
164 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
165 }
166
167 dryRun: boolean, Optional. Whether to run a dry run to validate the request (without actually creating the model).
168 x__xgafv: string, V1 error format.
169 Allowed values
170 1 - v1 error format
171 2 - v2 error format
172
173 Returns:
174 An object of the form:
175
176 { # This resource represents a long-running operation that is the result of a network API call.
177 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
178 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
179 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
180 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
181 {
182 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
183 },
184 ],
185 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
186 },
187 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
188 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
189 },
190 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
191 &quot;response&quot;: { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
192 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
193 },
194 }</pre>
195 </div>
196
197 <div class="method">
198 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
199 <pre>Deletes an existing model.
200
201 Args:
202 name: string, Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
203 x__xgafv: string, V1 error format.
204 Allowed values
205 1 - v1 error format
206 2 - v2 error format
207
208 Returns:
209 An object of the form:
210
211 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
212 }</pre>
213 </div>
214
215 <div class="method">
216 <code class="details" id="get">get(name, x__xgafv=None)</code>
217 <pre>Gets a model.
218
219 Args:
220 name: string, Required. The resource name of the Model to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` (required)
221 x__xgafv: string, V1 error format.
222 Allowed values
223 1 - v1 error format
224 2 - v2 error format
225
226 Returns:
227 An object of the form:
228
229 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
230 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
231 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
232 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
233 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
234 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
235 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
236 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
237 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
238 },
239 },
240 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
241 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
242 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
243 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
244 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
245 { # An individual panel with a list of ServingConfigs to consider for it.
246 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
247 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
248 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
249 },
250 ],
251 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
252 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
253 },
254 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
255 },
256 ],
257 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
258 },
259 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
260 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
261 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
262 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
263 &quot;A String&quot;,
264 ],
265 },
266 ],
267 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
268 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
269 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
270 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
271 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
272 }</pre>
273 </div>
274
275 <div class="method">
276 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
277 <pre>Lists all the models linked to this event store.
278
279 Args:
280 parent: string, Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` (required)
281 pageSize: integer, Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
282 pageToken: string, Optional. A page token, received from a previous `ListModels` call. Provide this to retrieve the subsequent page.
283 x__xgafv: string, V1 error format.
284 Allowed values
285 1 - v1 error format
286 2 - v2 error format
287
288 Returns:
289 An object of the form:
290
291 { # Response to a ListModelRequest.
292 &quot;models&quot;: [ # List of Models.
293 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
294 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
295 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
296 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
297 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
298 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
299 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
300 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
301 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
302 },
303 },
304 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
305 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
306 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
307 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
308 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
309 { # An individual panel with a list of ServingConfigs to consider for it.
310 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
311 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
312 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
313 },
314 ],
315 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
316 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
317 },
318 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
319 },
320 ],
321 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
322 },
323 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
324 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
325 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
326 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
327 &quot;A String&quot;,
328 ],
329 },
330 ],
331 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
332 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
333 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
334 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
335 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
336 },
337 ],
338 &quot;nextPageToken&quot;: &quot;A String&quot;, # Pagination token, if not returned indicates the last page.
339 }</pre>
340 </div>
341
342 <div class="method">
343 <code class="details" id="list_next">list_next()</code>
344 <pre>Retrieves the next page of results.
345
346 Args:
347 previous_request: The request for the previous page. (required)
348 previous_response: The response from the request for the previous page. (required)
349
350 Returns:
351 A request object that you can call &#x27;execute()&#x27; on to request the next
352 page. Returns None if there are no more items in the collection.
353 </pre>
354 </div>
355
356 <div class="method">
357 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
358 <pre>Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.
359
360 Args:
361 name: string, Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40. (required)
362 body: object, The request body.
363 The object takes the form of:
364
365 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
366 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
367 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
368 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
369 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
370 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
371 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
372 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
373 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
374 },
375 },
376 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
377 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
378 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
379 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
380 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
381 { # An individual panel with a list of ServingConfigs to consider for it.
382 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
383 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
384 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
385 },
386 ],
387 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
388 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
389 },
390 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
391 },
392 ],
393 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
394 },
395 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
396 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
397 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
398 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
399 &quot;A String&quot;,
400 ],
401 },
402 ],
403 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
404 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
405 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
406 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
407 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
408 }
409
410 updateMask: string, Optional. Indicates which fields in the provided &#x27;model&#x27; to update. If not set, by default updates all fields.
411 x__xgafv: string, V1 error format.
412 Allowed values
413 1 - v1 error format
414 2 - v2 error format
415
416 Returns:
417 An object of the form:
418
419 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
420 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
421 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
422 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
423 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
424 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
425 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
426 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
427 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
428 },
429 },
430 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
431 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
432 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
433 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
434 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
435 { # An individual panel with a list of ServingConfigs to consider for it.
436 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
437 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
438 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
439 },
440 ],
441 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
442 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
443 },
444 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
445 },
446 ],
447 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
448 },
449 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
450 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
451 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
452 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
453 &quot;A String&quot;,
454 ],
455 },
456 ],
457 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
458 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
459 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
460 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
461 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
462 }</pre>
463 </div>
464
465 <div class="method">
466 <code class="details" id="pause">pause(name, body=None, x__xgafv=None)</code>
467 <pre>Pauses the training of an existing model.
468
469 Args:
470 name: string, Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
471 body: object, The request body.
472 The object takes the form of:
473
474 { # Request for pausing training of a model.
475 }
476
477 x__xgafv: string, V1 error format.
478 Allowed values
479 1 - v1 error format
480 2 - v2 error format
481
482 Returns:
483 An object of the form:
484
485 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
486 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
487 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
488 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
489 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
490 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
491 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
492 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
493 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
494 },
495 },
496 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
497 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
498 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
499 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
500 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
501 { # An individual panel with a list of ServingConfigs to consider for it.
502 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
503 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
504 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
505 },
506 ],
507 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
508 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
509 },
510 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
511 },
512 ],
513 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
514 },
515 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
516 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
517 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
518 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
519 &quot;A String&quot;,
520 ],
521 },
522 ],
523 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
524 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
525 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
526 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
527 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
528 }</pre>
529 </div>
530
531 <div class="method">
532 <code class="details" id="resume">resume(name, body=None, x__xgafv=None)</code>
533 <pre>Resumes the training of an existing model.
534
535 Args:
536 name: string, Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
537 body: object, The request body.
538 The object takes the form of:
539
540 { # Request for resuming training of a model.
541 }
542
543 x__xgafv: string, V1 error format.
544 Allowed values
545 1 - v1 error format
546 2 - v2 error format
547
548 Returns:
549 An object of the form:
550
551 { # Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.
552 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
553 &quot;dataState&quot;: &quot;A String&quot;, # Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.
554 &quot;displayName&quot;: &quot;A String&quot;, # Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.
555 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
556 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
557 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
558 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
559 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
560 },
561 },
562 &quot;name&quot;: &quot;A String&quot;, # Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.
563 &quot;optimizationObjective&quot;: &quot;A String&quot;, # Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
564 &quot;pageOptimizationConfig&quot;: { # The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configs to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. # Optional. The page optimization config.
565 &quot;pageOptimizationEventType&quot;: &quot;A String&quot;, # Required. The type of UserEvent this page optimization is shown for. Each page has an associated event type - this will be the corresponding event type for the page that the page optimization model is used on. Supported types: * `add-to-cart`: Products being added to cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed * `category-page-view`: Homepage viewed * `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` only allows models with type `recommended-for-you`. All other page_optimization_event_type allow all Model.types.
566 &quot;panels&quot;: [ # Required. A list of panel configurations. Limit = 5.
567 { # An individual panel with a list of ServingConfigs to consider for it.
568 &quot;candidates&quot;: [ # Required. The candidates to consider on the panel.
569 { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates.
570 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
571 },
572 ],
573 &quot;defaultCandidate&quot;: { # A candidate to consider for a given panel. Currently only ServingConfig are valid candidates. # Required. The default candidate. If the model fails at serving time, we fall back to the default.
574 &quot;servingConfigId&quot;: &quot;A String&quot;, # This has to be a valid ServingConfig identifier. For example, for a ServingConfig with full name: `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, this would be `my_candidate_config`.
575 },
576 &quot;displayName&quot;: &quot;A String&quot;, # Optional. The name to display for the panel.
577 },
578 ],
579 &quot;restriction&quot;: &quot;A String&quot;, # Optional. How to restrict results across panels e.g. can the same ServingConfig be shown on multiple panels at once. If unspecified, default to `UNIQUE_MODEL_RESTRICTION`.
580 },
581 &quot;periodicTuningState&quot;: &quot;A String&quot;, # Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.
582 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
583 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
584 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
585 &quot;A String&quot;,
586 ],
587 },
588 ],
589 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
590 &quot;trainingState&quot;: &quot;A String&quot;, # Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.
591 &quot;tuningOperation&quot;: &quot;A String&quot;, # Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.
592 &quot;type&quot;: &quot;A String&quot;, # Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
593 &quot;updateTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.
594 }</pre>
595 </div>
596
597 <div class="method">
598 <code class="details" id="tune">tune(name, body=None, x__xgafv=None)</code>
599 <pre>Tunes an existing model.
600
601 Args:
602 name: string, Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
603 body: object, The request body.
604 The object takes the form of:
605
606 { # Request to manually start a tuning process now (instead of waiting for the periodically scheduled tuning to happen).
607 }
608
609 x__xgafv: string, V1 error format.
610 Allowed values
611 1 - v1 error format
612 2 - v2 error format
613
614 Returns:
615 An object of the form:
616
617 { # This resource represents a long-running operation that is the result of a network API call.
618 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
619 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
620 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
621 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
622 {
623 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
624 },
625 ],
626 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
627 },
628 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
629 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
630 },
631 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
632 &quot;response&quot;: { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
633 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
634 },
635 }</pre>
636 </div>
637
638 </body></html>