pub struct TraceLayer { /* private fields */ }Expand description
The probe decorator. Wrap a model; every call is fingerprinted and recorded to the sink.
Implementations§
Source§impl TraceLayer
impl TraceLayer
Sourcepub fn new(inner: Arc<dyn LanguageModel>, sink: Arc<dyn TraceSink>) -> Self
pub fn new(inner: Arc<dyn LanguageModel>, sink: Arc<dyn TraceSink>) -> Self
Wrap a model with a sink (records every call).
Sourcepub fn with_default_session(self, session_id: String, key: [u8; 32]) -> Self
pub fn with_default_session(self, session_id: String, key: [u8; 32]) -> Self
Default session id (used when CallOptions.session_id is absent) +
session key (32-byte HMAC-style salt for fingerprint scoping).
Sourcepub fn with_auditor(self, auditor: Arc<dyn CacheAuditor>) -> Self
pub fn with_auditor(self, auditor: Arc<dyn CacheAuditor>) -> Self
Attach an auditor (default: none — verdict stays None).
Sourcepub fn with_rules_auditor(self, strict: bool) -> Self
pub fn with_rules_auditor(self, strict: bool) -> Self
Convenience: attach the built-in rules auditor in strict/shared mode.
Trait Implementations§
Source§impl LanguageModel for TraceLayer
impl LanguageModel for TraceLayer
Source§fn config_snapshot(&self) -> ProviderRecord
fn config_snapshot(&self) -> ProviderRecord
RFC-0023 §3.3: transparent decorators must forward the inner snapshot (otherwise recording sees the decorator’s minimal record).
Source§fn specification_version(&self) -> &'static str
fn specification_version(&self) -> &'static str
Specification version (always
"v4").Source§fn retry_config(&self) -> RetryConfig
fn retry_config(&self) -> RetryConfig
Provider/model retry settings used when the caller does not override
the retry count.
Source§fn do_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
options: &'life1 CallOptions,
) -> Pin<Box<dyn Future<Output = Result<GenerateResult, AiMuxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn do_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
options: &'life1 CallOptions,
) -> Pin<Box<dyn Future<Output = Result<GenerateResult, AiMuxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a complete (non-streaming) response.
Source§fn do_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
options: &'life1 CallOptions,
) -> Pin<Box<dyn Future<Output = Result<StreamResult, AiMuxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn do_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
options: &'life1 CallOptions,
) -> Pin<Box<dyn Future<Output = Result<StreamResult, AiMuxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a streaming response.
Auto Trait Implementations§
impl !RefUnwindSafe for TraceLayer
impl !UnwindSafe for TraceLayer
impl Freeze for TraceLayer
impl Send for TraceLayer
impl Sync for TraceLayer
impl Unpin for TraceLayer
impl UnsafeUnpin for TraceLayer
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