Skip to main content

ContentRedactor

Trait ContentRedactor 

Source
pub trait ContentRedactor:
    Send
    + Sync
    + Debug {
    // Required method
    fn redact(&self, role: ContentRole, text: &str) -> Option<String>;
}
Expand description

Decides what, if anything, of a prompt or completion may be recorded.

The hook is mandatory: content recording cannot be switched on without one, so there is no configuration in which raw user text reaches the backend unexamined. Returning None drops the content entirely.

Required Methods§

Source

fn redact(&self, role: ContentRole, text: &str) -> Option<String>

Returns the text that may be recorded, or None to record nothing.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§