pub struct JailbreakDetector { /* private fields */ }Expand description
Jailbreak detector/guard core (thread-safe).
Implementations§
Source§impl JailbreakDetector
impl JailbreakDetector
pub fn new() -> Self
pub fn with_config(config: JailbreakGuardConfig) -> Self
pub fn with_llm_judge<J>(self, judge: J) -> Selfwhere
J: LlmJudge + 'static,
pub fn with_session_store<S>(self, store: S) -> Selfwhere
S: SessionStore + 'static,
pub fn config(&self) -> &JailbreakGuardConfig
pub async fn detect( &self, input: &str, session_id: Option<&str>, ) -> JailbreakDetectionResult
pub fn detect_sync( &self, input: &str, session_id: Option<&str>, ) -> JailbreakDetectionResult
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for JailbreakDetector
impl !RefUnwindSafe for JailbreakDetector
impl Send for JailbreakDetector
impl Sync for JailbreakDetector
impl Unpin for JailbreakDetector
impl !UnwindSafe for JailbreakDetector
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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