pub struct PurviewChatMiddleware(/* private fields */);Expand description
Chat-client middleware variant of PurviewAgentMiddleware, for
attaching Purview enforcement directly to a ChatClient
rather than an agent’s middleware pipeline. Mirrors Python’s
PurviewChatPolicyMiddleware; the policy logic is identical (see
the internal PurviewPolicyCore) — only the hook point (and result/message types)
differ.
Implementations§
Source§impl PurviewChatMiddleware
impl PurviewChatMiddleware
pub fn new( token_provider: impl TokenProvider + 'static, settings: PurviewSettings, ) -> Self
Trait Implementations§
Source§impl Middleware<ChatContext> for PurviewChatMiddleware
impl Middleware<ChatContext> for PurviewChatMiddleware
fn process<'life0, 'async_trait>(
&'life0 self,
ctx: ChatContext,
next: Next<ChatContext>,
) -> Pin<Box<dyn Future<Output = Result<ChatContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for PurviewChatMiddleware
impl !UnwindSafe for PurviewChatMiddleware
impl Freeze for PurviewChatMiddleware
impl Send for PurviewChatMiddleware
impl Sync for PurviewChatMiddleware
impl Unpin for PurviewChatMiddleware
impl UnsafeUnpin for PurviewChatMiddleware
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