pub struct ModerationApi<'a>(/* private fields */);
Expand description
ModerationApi
struct to interact with the moderation endpoint of the API.
Implementations§
Source§impl<'a> ModerationApi<'a>
impl<'a> ModerationApi<'a>
Sourcepub async fn moderate(
&self,
input: &str,
model: Option<&str>,
) -> OpenAIResult<Value>
pub async fn moderate( &self, input: &str, model: Option<&str>, ) -> OpenAIResult<Value>
Submit text input for moderation.
§Arguments
input
- The text input to be moderated.model
- Optional name of the moderation model to use.
§Returns
A Result containing the JSON response as serde_json::Value
on success, or an OpenAIError
on failure.
Auto Trait Implementations§
impl<'a> Freeze for ModerationApi<'a>
impl<'a> !RefUnwindSafe for ModerationApi<'a>
impl<'a> Send for ModerationApi<'a>
impl<'a> Sync for ModerationApi<'a>
impl<'a> Unpin for ModerationApi<'a>
impl<'a> !UnwindSafe for ModerationApi<'a>
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