#[non_exhaustive]pub struct MediaRecommendationEngineConfig {
pub type: String,
pub optimization_objective: String,
pub optimization_objective_config: Option<OptimizationObjectiveConfig>,
pub training_state: TrainingState,
pub engine_features_config: Option<EngineFeaturesConfig>,
/* private fields */
}engine-service only.Expand description
Additional config specs for a Media Recommendation engine.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type: StringRequired. The type of engine. e.g., recommended-for-you.
This field together with optimization_objective describe engine metadata to use to control engine training and serving.
Currently supported values: recommended-for-you, others-you-may-like,
more-like-this, most-popular-items.
optimization_objective: StringThe optimization objective. e.g., cvr.
This field together with optimization_objective describe engine metadata to use to control engine training and serving.
Currently supported
values: ctr, cvr.
If not specified, we choose default based on engine type. Default depends on type of recommendation:
recommended-for-you => ctr
others-you-may-like => ctr
optimization_objective_config: Option<OptimizationObjectiveConfig>Name and value of the custom threshold for cvr optimization_objective.
For target_field watch-time, target_field_value must be an integer
value indicating the media progress time in seconds between (0, 86400]
(excludes 0, includes 86400) (e.g., 90).
For target_field watch-percentage, the target_field_value must be a
valid float value between (0, 1.0] (excludes 0, includes 1.0) (e.g.,
0.5).
training_state: TrainingStateThe training state that the engine 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
engine in order to control cost. If not specified: the default value for
CreateEngine method is TRAINING. The default value for
UpdateEngine method is to keep the state the same as before.
engine_features_config: Option<EngineFeaturesConfig>Optional. Additional engine features config.
Implementations§
Source§impl MediaRecommendationEngineConfig
impl MediaRecommendationEngineConfig
Sourcepub fn set_optimization_objective<T: Into<String>>(self, v: T) -> Self
pub fn set_optimization_objective<T: Into<String>>(self, v: T) -> Self
Sets the value of optimization_objective.
§Example
let x = MediaRecommendationEngineConfig::new().set_optimization_objective("example");Sourcepub fn set_optimization_objective_config<T>(self, v: T) -> Selfwhere
T: Into<OptimizationObjectiveConfig>,
pub fn set_optimization_objective_config<T>(self, v: T) -> Selfwhere
T: Into<OptimizationObjectiveConfig>,
Sets the value of optimization_objective_config.
§Example
use google_cloud_discoveryengine_v1::model::engine::media_recommendation_engine_config::OptimizationObjectiveConfig;
let x = MediaRecommendationEngineConfig::new().set_optimization_objective_config(OptimizationObjectiveConfig::default()/* use setters */);Sourcepub fn set_or_clear_optimization_objective_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OptimizationObjectiveConfig>,
pub fn set_or_clear_optimization_objective_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OptimizationObjectiveConfig>,
Sets or clears the value of optimization_objective_config.
§Example
use google_cloud_discoveryengine_v1::model::engine::media_recommendation_engine_config::OptimizationObjectiveConfig;
let x = MediaRecommendationEngineConfig::new().set_or_clear_optimization_objective_config(Some(OptimizationObjectiveConfig::default()/* use setters */));
let x = MediaRecommendationEngineConfig::new().set_or_clear_optimization_objective_config(None::<OptimizationObjectiveConfig>);Sourcepub fn set_training_state<T: Into<TrainingState>>(self, v: T) -> Self
pub fn set_training_state<T: Into<TrainingState>>(self, v: T) -> Self
Sets the value of training_state.
§Example
use google_cloud_discoveryengine_v1::model::engine::media_recommendation_engine_config::TrainingState;
let x0 = MediaRecommendationEngineConfig::new().set_training_state(TrainingState::Paused);
let x1 = MediaRecommendationEngineConfig::new().set_training_state(TrainingState::Training);Sourcepub fn set_engine_features_config<T>(self, v: T) -> Selfwhere
T: Into<EngineFeaturesConfig>,
pub fn set_engine_features_config<T>(self, v: T) -> Selfwhere
T: Into<EngineFeaturesConfig>,
Sets the value of engine_features_config.
§Example
use google_cloud_discoveryengine_v1::model::engine::media_recommendation_engine_config::EngineFeaturesConfig;
let x = MediaRecommendationEngineConfig::new().set_engine_features_config(EngineFeaturesConfig::default()/* use setters */);Sourcepub fn set_or_clear_engine_features_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EngineFeaturesConfig>,
pub fn set_or_clear_engine_features_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EngineFeaturesConfig>,
Sets or clears the value of engine_features_config.
§Example
use google_cloud_discoveryengine_v1::model::engine::media_recommendation_engine_config::EngineFeaturesConfig;
let x = MediaRecommendationEngineConfig::new().set_or_clear_engine_features_config(Some(EngineFeaturesConfig::default()/* use setters */));
let x = MediaRecommendationEngineConfig::new().set_or_clear_engine_features_config(None::<EngineFeaturesConfig>);Trait Implementations§
Source§impl Clone for MediaRecommendationEngineConfig
impl Clone for MediaRecommendationEngineConfig
Source§fn clone(&self) -> MediaRecommendationEngineConfig
fn clone(&self) -> MediaRecommendationEngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MediaRecommendationEngineConfig
impl Default for MediaRecommendationEngineConfig
Source§fn default() -> MediaRecommendationEngineConfig
fn default() -> MediaRecommendationEngineConfig
impl StructuralPartialEq for MediaRecommendationEngineConfig
Auto Trait Implementations§
impl Freeze for MediaRecommendationEngineConfig
impl RefUnwindSafe for MediaRecommendationEngineConfig
impl Send for MediaRecommendationEngineConfig
impl Sync for MediaRecommendationEngineConfig
impl Unpin for MediaRecommendationEngineConfig
impl UnsafeUnpin for MediaRecommendationEngineConfig
impl UnwindSafe for MediaRecommendationEngineConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request