pub struct RecordingChatModel { /* private fields */ }Expand description
A ChatModel that records every call into the run’s journal in the
canonical replay-compatible shape, then returns the real response.
Construct per node invocation (it is a cheap handle): the causal parent is
the invocation’s node-input event id, delivered to node code via
crate::journal::PARENT_EVENT_KEY. This is the supported way to produce
journals that ReplayingChatModel can later replay — hand-rolled
journaling must reproduce the same canonical shapes to be replayable.
Implementations§
Trait Implementations§
Source§impl ChatModel for RecordingChatModel
impl ChatModel for RecordingChatModel
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 RecordingChatModel
impl !UnwindSafe for RecordingChatModel
impl Freeze for RecordingChatModel
impl Send for RecordingChatModel
impl Sync for RecordingChatModel
impl Unpin for RecordingChatModel
impl UnsafeUnpin for RecordingChatModel
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