pub struct Moderations<'c, C: Config> { /* private fields */ }Available on crate feature
moderation only.Expand description
Given text and/or image inputs, classifies if those inputs are potentially harmful across several categories.
Related guide: Moderations
Implementations§
Source§impl<'c, C: Config> Moderations<'c, C>
impl<'c, C: Config> Moderations<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn create(
&self,
request: CreateModerationRequest,
) -> Result<CreateModerationResponse, OpenAIError>
pub async fn create( &self, request: CreateModerationRequest, ) -> Result<CreateModerationResponse, OpenAIError>
Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide. Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.
Sourcepub async fn create_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for Moderations<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for Moderations<'c, C>
Available on crate feature
_api only.Source§fn options_mut(&mut self) -> &mut RequestOptions
fn options_mut(&mut self) -> &mut RequestOptions
Get mutable reference to RequestOptions (for building)
Source§fn options(&self) -> &RequestOptions
fn options(&self) -> &RequestOptions
Get reference to RequestOptions
Source§fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
Add a single header to RequestOptions
Auto Trait Implementations§
impl<'c, C> Freeze for Moderations<'c, C>
impl<'c, C> !RefUnwindSafe for Moderations<'c, C>
impl<'c, C> Send for Moderations<'c, C>
impl<'c, C> Sync for Moderations<'c, C>
impl<'c, C> Unpin for Moderations<'c, C>
impl<'c, C> !UnwindSafe for Moderations<'c, C>
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