#[non_exhaustive]pub struct ComputationBasedMetricSpec {
pub type: Option<ComputationBasedMetricType>,
pub parameters: Option<Struct>,
/* private fields */
}Available on crate feature
gen-ai-tuning-service only.Expand description
Specification for a computation based metric.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type: Option<ComputationBasedMetricType>Required. The type of the computation based metric.
parameters: Option<Struct>Optional. A map of parameters for the metric, e.g. {“rouge_type”: “rougeL”}.
Implementations§
Source§impl ComputationBasedMetricSpec
impl ComputationBasedMetricSpec
pub fn new() -> Self
Sourcepub fn set_type<T>(self, v: T) -> Selfwhere
T: Into<ComputationBasedMetricType>,
pub fn set_type<T>(self, v: T) -> Selfwhere
T: Into<ComputationBasedMetricType>,
Sets the value of r#type.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::computation_based_metric_spec::ComputationBasedMetricType;
let x0 = ComputationBasedMetricSpec::new().set_type(ComputationBasedMetricType::ExactMatch);
let x1 = ComputationBasedMetricSpec::new().set_type(ComputationBasedMetricType::Bleu);
let x2 = ComputationBasedMetricSpec::new().set_type(ComputationBasedMetricType::Rouge);Sourcepub fn set_or_clear_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ComputationBasedMetricType>,
pub fn set_or_clear_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ComputationBasedMetricType>,
Sets or clears the value of r#type.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::computation_based_metric_spec::ComputationBasedMetricType;
let x0 = ComputationBasedMetricSpec::new().set_or_clear_type(Some(ComputationBasedMetricType::ExactMatch));
let x1 = ComputationBasedMetricSpec::new().set_or_clear_type(Some(ComputationBasedMetricType::Bleu));
let x2 = ComputationBasedMetricSpec::new().set_or_clear_type(Some(ComputationBasedMetricType::Rouge));
let x_none = ComputationBasedMetricSpec::new().set_or_clear_type(None::<ComputationBasedMetricType>);Sourcepub fn set_parameters<T>(self, v: T) -> Self
pub fn set_parameters<T>(self, v: T) -> Self
Sets the value of parameters.
§Example
ⓘ
use wkt::Struct;
let x = ComputationBasedMetricSpec::new().set_parameters(Struct::default()/* use setters */);Sourcepub fn set_or_clear_parameters<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_parameters<T>(self, v: Option<T>) -> Self
Sets or clears the value of parameters.
§Example
ⓘ
use wkt::Struct;
let x = ComputationBasedMetricSpec::new().set_or_clear_parameters(Some(Struct::default()/* use setters */));
let x = ComputationBasedMetricSpec::new().set_or_clear_parameters(None::<Struct>);Trait Implementations§
Source§impl Clone for ComputationBasedMetricSpec
impl Clone for ComputationBasedMetricSpec
Source§fn clone(&self) -> ComputationBasedMetricSpec
fn clone(&self) -> ComputationBasedMetricSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComputationBasedMetricSpec
impl Debug for ComputationBasedMetricSpec
Source§impl Default for ComputationBasedMetricSpec
impl Default for ComputationBasedMetricSpec
Source§fn default() -> ComputationBasedMetricSpec
fn default() -> ComputationBasedMetricSpec
Returns the “default value” for a type. Read more
Source§impl Message for ComputationBasedMetricSpec
impl Message for ComputationBasedMetricSpec
impl StructuralPartialEq for ComputationBasedMetricSpec
Auto Trait Implementations§
impl Freeze for ComputationBasedMetricSpec
impl RefUnwindSafe for ComputationBasedMetricSpec
impl Send for ComputationBasedMetricSpec
impl Sync for ComputationBasedMetricSpec
impl Unpin for ComputationBasedMetricSpec
impl UnsafeUnpin for ComputationBasedMetricSpec
impl UnwindSafe for ComputationBasedMetricSpec
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
Mutably borrows from an owned value. Read more