Skip to main content

Module middleware

Module middleware 

Source
Expand description

PurviewAgentMiddleware and PurviewChatMiddleware: enforce Purview policy on both the outgoing prompt and the model/agent response. Mirrors Python’s PurviewPolicyMiddleware (agent-level) and PurviewChatPolicyMiddleware (chat-client-level) — see the crate docs for which hook points these attach to and why both directions evaluate with Activity::UploadText.

Structs§

PurviewAgentMiddleware
SupportsAgentRun middleware enforcing Purview policy on both the outgoing prompt and the agent’s response. Mirrors Python’s PurviewPolicyMiddleware.
PurviewChatMiddleware
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.