NAME

Google::Cloud::Retail::V2beta::Model - Compiled Protocol Buffers messages for google/cloud/retail/v2beta/model.proto

SYNOPSIS

use Google::Cloud::Retail::V2beta::Model;

my $msg = Google::Cloud::Retail::V2beta::Model::Model->new({
    name => $name,
    display_name => $display_name,
    training_state => $training_state,
    serving_state => $serving_state,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Retail::V2beta::Model::Model->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/retail/v2beta/model.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Retail::V2beta::Model::Model

Metadata that describes the training and serving parameters of a [Model][google.cloud.retail.v2beta.Model]. A [Model][google.cloud.retail.v2beta.Model] can be associated with a [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and then queried through the Predict API.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: 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.

  • $msg->display_name() / $msg->display_name($value)

    Type: String

    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.

  • $msg->training_state() / $msg->training_state($value)

    Type: Enum (Google::Cloud::Retail::V2beta::Model::TrainingState)

    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.

  • $msg->serving_state() / $msg->serving_state($value)

    Type: Enum (Google::Cloud::Retail::V2beta::Model::ServingState)

    Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.

  • $msg->create_time() / $msg->create_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. Timestamp the Recommendation Model was created at.

  • $msg->update_time() / $msg->update_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    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.

  • $msg->type() / $msg->type($value)

    Type: String

    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][google.cloud.retail.v2beta.Model.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.

  • $msg->optimization_objective() / $msg->optimization_objective($value)

    Type: String

    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` => `ctr`

    `others-you-may-like` => `ctr`

    `frequently-bought-together` => `revenue_per_order`

    This field together with [optimization_objective][google.cloud.retail.v2beta.Model.type] 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.

  • $msg->periodic_tuning_state() / $msg->periodic_tuning_state($value)

    Type: Enum (Google::Cloud::Retail::V2beta::Model::PeriodicTuningState)

    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`.

  • $msg->last_tune_time() / $msg->last_tune_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. The timestamp when the latest successful tune finished.

  • $msg->tuning_operation() / $msg->tuning_operation($value)

    Type: String

    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.

  • $msg->data_state() / $msg->data_state($value)

    Type: Enum (Google::Cloud::Retail::V2beta::Model::DataState)

    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.

  • $msg->filtering_option() / $msg->filtering_option($value)

    Type: Enum (Google::Cloud::Retail::V2beta::RecommendationsFilteringOption)

    Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.

  • $msg->serving_config_lists() / $msg->serving_config_lists($value)

    Type: Message (Google::Cloud::Retail::V2beta::Model::Model::ServingConfigList)

    Output only. The list of valid serving configs associated with the PageOptimizationConfig.

  • $msg->model_features_config() / $msg->model_features_config($value)

    Type: Message (Google::Cloud::Retail::V2beta::Model::Model::ModelFeaturesConfig)

    Optional. Additional model features config.

Enum: Model::ServingState

  • SERVING_STATE_UNSPECIFIED => 0

  • INACTIVE => 1

  • ACTIVE => 2

  • TUNED => 3

Enum: Model::TrainingState

  • TRAINING_STATE_UNSPECIFIED => 0

  • PAUSED => 1

  • TRAINING => 2

Enum: Model::PeriodicTuningState

  • PERIODIC_TUNING_STATE_UNSPECIFIED => 0

  • PERIODIC_TUNING_DISABLED => 1

  • ALL_TUNING_DISABLED => 3

  • PERIODIC_TUNING_ENABLED => 2

Enum: Model::DataState

  • DATA_STATE_UNSPECIFIED => 0

  • DATA_OK => 1

  • DATA_ERROR => 2

Enum: Model::ContextProductsType

  • CONTEXT_PRODUCTS_TYPE_UNSPECIFIED => 0

  • SINGLE_CONTEXT_PRODUCT => 1

  • MULTIPLE_CONTEXT_PRODUCTS => 2

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Retail::V2beta::Model::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.