pub struct ModelVersion(/* private fields */);Expand description
The model version to use for ModerateText.
Implementations§
Source§impl ModelVersion
impl ModelVersion
Sourcepub const MODEL_VERSION_UNSPECIFIED: ModelVersion
pub const MODEL_VERSION_UNSPECIFIED: ModelVersion
The default model version.
Sourcepub const MODEL_VERSION_1: ModelVersion
pub const MODEL_VERSION_1: ModelVersion
Use the v1 model, this model is used by default when not provided. The v1 model only returns probability (confidence) score for each category.
Sourcepub const MODEL_VERSION_2: ModelVersion
pub const MODEL_VERSION_2: ModelVersion
Use the v2 model. The v2 model only returns probability (confidence) score for each category, and returns severity score for a subset of the categories.
Sourcepub fn as_str_name(&self) -> Cow<'static, str>
pub fn as_str_name(&self) -> Cow<'static, str>
Gets the enum value as a string.
Sourcepub fn from_str_name(name: &str) -> Option<Self>
pub fn from_str_name(name: &str) -> Option<Self>
Creates an enum value from the value name.
Trait Implementations§
Source§impl Clone for ModelVersion
impl Clone for ModelVersion
Source§fn clone(&self) -> ModelVersion
fn clone(&self) -> ModelVersion
Returns a copy 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 ModelVersion
impl Debug for ModelVersion
Source§impl Default for ModelVersion
impl Default for ModelVersion
Source§impl<'de> Deserialize<'de> for ModelVersion
impl<'de> Deserialize<'de> for ModelVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<i32> for ModelVersion
impl From<i32> for ModelVersion
Source§impl PartialEq for ModelVersion
impl PartialEq for ModelVersion
Source§impl Serialize for ModelVersion
impl Serialize for ModelVersion
impl StructuralPartialEq for ModelVersion
Auto Trait Implementations§
impl Freeze for ModelVersion
impl RefUnwindSafe for ModelVersion
impl Send for ModelVersion
impl Sync for ModelVersion
impl Unpin for ModelVersion
impl UnwindSafe for ModelVersion
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