pub struct RecordingProvider { /* private fields */ }Expand description
A provider that records every request and reply through to disk.
The recorded reply is the one that came back — no synthesis, no re-encoding.
Implementations§
Trait Implementations§
Source§impl ChatProvider for RecordingProvider
impl ChatProvider for RecordingProvider
Source§fn can_see(&self) -> bool
fn can_see(&self) -> bool
Whatever the wrapped provider declares (#361). Without this, a recording run refuses a
picture the model it is recording can read, and the cassette has no turn to replay.
Source§fn chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
) -> Pin<Box<dyn Future<Output = Result<Message>> + 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 [Message],
tools: &'life2 [ToolSpec],
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send the conversation and return the assistant’s reply (text and/or tool calls).
Source§fn chat_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
on_delta: DeltaFn<'life3>,
) -> Pin<Box<dyn Future<Output = Result<Message>> + 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 [Message],
tools: &'life2 [ToolSpec],
on_delta: DeltaFn<'life3>,
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Like
chat, but reports assistant text through on_delta as it is
generated. The returned message is always the complete reply. Providers that
cannot stream just answer normally and emit no deltas.Source§fn chat_stream_patched<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
on_delta: DeltaFn<'life3>,
patch: &'life4 RequestPatch,
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn chat_stream_patched<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
on_delta: DeltaFn<'life3>,
patch: &'life4 RequestPatch,
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
One streaming turn with a request patch applied. Read more
Source§fn take_usage(&self) -> Option<TurnUsage>
fn take_usage(&self) -> Option<TurnUsage>
What the most recent call cost, if the server said. Taken rather than borrowed so a
caller cannot show the same turn twice; providers that do not measure return
None.Auto Trait Implementations§
impl !Freeze for RecordingProvider
impl !RefUnwindSafe for RecordingProvider
impl !UnwindSafe for RecordingProvider
impl Forget for RecordingProvider
impl Move for RecordingProvider
impl Send for RecordingProvider
impl Sync for RecordingProvider
impl Unpin for RecordingProvider
impl UnsafeUnpin for RecordingProviderwhere
*const ArcInner<dyn ChatProvider> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ChatProvider>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<RecordedRequest>: UnsafeUnpin,
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