pub struct Moderation {
pub model: Model,
pub input: Vec<String>,
}
Expand description
Given a input text, outputs if the model classifies it as violating OpenAI’s content policy.
Fields§
§model: Model
§input: Vec<String>
Implementations§
Source§impl Moderation
impl Moderation
Sourcepub fn model(self, model: Model) -> Self
pub fn model(self, model: Model) -> Self
Two content moderations models are available: text-moderation-stable
and text-moderation-latest
.
The default is text-moderation-latest
which will be automatically
upgraded over time. This ensures you are always using our most accurate
model. If you use text-moderation-stable
, we will provide advanced
notice before updating the model. Accuracy of text-moderation-stable
may be slightly lower than for text-moderation-latest
.
Trait Implementations§
Source§impl Debug for Moderation
impl Debug for Moderation
Source§impl Default for Moderation
impl Default for Moderation
Source§impl<'de> Deserialize<'de> for Moderation
impl<'de> Deserialize<'de> for Moderation
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
Auto Trait Implementations§
impl Freeze for Moderation
impl RefUnwindSafe for Moderation
impl Send for Moderation
impl Sync for Moderation
impl Unpin for Moderation
impl UnwindSafe for Moderation
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