pub struct Moderations<'c, C: Config> { /* private fields */ }
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.
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>where
C: Sync,
impl<'c, C> Sync for Moderations<'c, C>where
C: Sync,
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