pub struct ReplayingChatModel { /* private fields */ }Expand description
A ChatModel that answers every call from a recorded journal instead of
executing it.
The wrapped implementation is carried for its identity (ChatModel::effect)
and is never invoked: there is no code path from chat to inner, so
replaying with a panic-on-call sentinel (or a client with no credentials
and no network) is safe. Each call is matched against the journal by
sequence + request hash and answered with the recorded response; the
served event is re-journaled into the replay run’s journal so the
replayed evidence reproduces the recorded evidence byte-for-byte.
Implementations§
Trait Implementations§
Source§impl ChatModel for ReplayingChatModel
impl ChatModel for ReplayingChatModel
Source§fn chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Produce the next assistant message for the conversation.
Source§fn effect(&self) -> Effect
fn effect(&self) -> Effect
The declared effect classification of calling this model (Flight
Recorder, R0.5): recorded on model-call journal events and used by
retry/replay policy. Read more
Source§fn chat_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
on_token: &'life3 mut (dyn FnMut(TokenChunk) + Send),
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn chat_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
on_token: &'life3 mut (dyn FnMut(TokenChunk) + Send),
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Produce the next assistant message, streaming token deltas through
on_token as they arrive. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ReplayingChatModel
impl !UnwindSafe for ReplayingChatModel
impl Freeze for ReplayingChatModel
impl Send for ReplayingChatModel
impl Sync for ReplayingChatModel
impl Unpin for ReplayingChatModel
impl UnsafeUnpin for ReplayingChatModel
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