#[non_exhaustive]pub struct AutoraterConfig {
pub sampling_count: Option<i32>,
pub flip_enabled: Option<bool>,
pub autorater_model: String,
pub generation_config: Option<GenerationConfig>,
/* private fields */
}gen-ai-tuning-service only.Expand description
The configs for autorater. This is applicable to both EvaluateInstances and EvaluateDataset.
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.sampling_count: Option<i32>Optional. Number of samples for each instance in the dataset. If not specified, the default is 4. Minimum value is 1, maximum value is 32.
flip_enabled: Option<bool>Optional. Default is true. Whether to flip the candidate and baseline responses. This is only applicable to the pairwise metric. If enabled, also provide PairwiseMetricSpec.candidate_response_field_name and PairwiseMetricSpec.baseline_response_field_name. When rendering PairwiseMetricSpec.metric_prompt_template, the candidate and baseline fields will be flipped for half of the samples to reduce bias.
autorater_model: StringOptional. The fully qualified name of the publisher model or tuned autorater endpoint to use.
Publisher model format:
projects/{project}/locations/{location}/publishers/*/models/*
Tuned model endpoint format:
projects/{project}/locations/{location}/endpoints/{endpoint}
generation_config: Option<GenerationConfig>Optional. Configuration options for model generation and outputs.
Implementations§
Source§impl AutoraterConfig
impl AutoraterConfig
pub fn new() -> Self
Sourcepub fn set_sampling_count<T>(self, v: T) -> Self
pub fn set_sampling_count<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_sampling_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_sampling_count<T>(self, v: Option<T>) -> Self
Sets or clears the value of sampling_count.
§Example
let x = AutoraterConfig::new().set_or_clear_sampling_count(Some(42));
let x = AutoraterConfig::new().set_or_clear_sampling_count(None::<i32>);Sourcepub fn set_flip_enabled<T>(self, v: T) -> Self
pub fn set_flip_enabled<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_flip_enabled<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_flip_enabled<T>(self, v: Option<T>) -> Self
Sets or clears the value of flip_enabled.
§Example
let x = AutoraterConfig::new().set_or_clear_flip_enabled(Some(false));
let x = AutoraterConfig::new().set_or_clear_flip_enabled(None::<bool>);Sourcepub fn set_autorater_model<T: Into<String>>(self, v: T) -> Self
pub fn set_autorater_model<T: Into<String>>(self, v: T) -> Self
Sets the value of autorater_model.
§Example
let x = AutoraterConfig::new().set_autorater_model("example");Sourcepub fn set_generation_config<T>(self, v: T) -> Selfwhere
T: Into<GenerationConfig>,
pub fn set_generation_config<T>(self, v: T) -> Selfwhere
T: Into<GenerationConfig>,
Sets the value of generation_config.
§Example
use google_cloud_aiplatform_v1::model::GenerationConfig;
let x = AutoraterConfig::new().set_generation_config(GenerationConfig::default()/* use setters */);Sourcepub fn set_or_clear_generation_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<GenerationConfig>,
pub fn set_or_clear_generation_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<GenerationConfig>,
Sets or clears the value of generation_config.
§Example
use google_cloud_aiplatform_v1::model::GenerationConfig;
let x = AutoraterConfig::new().set_or_clear_generation_config(Some(GenerationConfig::default()/* use setters */));
let x = AutoraterConfig::new().set_or_clear_generation_config(None::<GenerationConfig>);Trait Implementations§
Source§impl Clone for AutoraterConfig
impl Clone for AutoraterConfig
Source§fn clone(&self) -> AutoraterConfig
fn clone(&self) -> AutoraterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more