pub struct RecordingProvider<P: ModelProvider> { /* private fields */ }Expand description
Wraps another provider and records everything it answers.
Implementations§
Source§impl<P: ModelProvider> RecordingProvider<P>
impl<P: ModelProvider> RecordingProvider<P>
pub fn new(inner: P, agent: impl Into<String>) -> RecordingProvider<P>
Sourcepub fn with_inputs(
self,
inputs: BTreeMap<String, Value>,
) -> RecordingProvider<P>
pub fn with_inputs( self, inputs: BTreeMap<String, Value>, ) -> RecordingProvider<P>
Record the inputs alongside the interactions.
pub fn finish(self) -> Cassette
Trait Implementations§
Source§impl<P: ModelProvider> ModelProvider for RecordingProvider<P>
impl<P: ModelProvider> ModelProvider for RecordingProvider<P>
fn complete( &mut self, request: &CompletionRequest, ) -> Result<CompletionResponse, ProviderError>
Source§fn complete_streaming(
&mut self,
request: &CompletionRequest,
on_delta: DeltaSink<'_>,
) -> Result<CompletionResponse, ProviderError>
fn complete_streaming( &mut self, request: &CompletionRequest, on_delta: DeltaSink<'_>, ) -> Result<CompletionResponse, ProviderError>
Complete a request, handing text to
on_delta as it arrives. Read moreAuto Trait Implementations§
impl<P> Freeze for RecordingProvider<P>where
P: Freeze,
impl<P> RefUnwindSafe for RecordingProvider<P>where
P: RefUnwindSafe,
impl<P> Send for RecordingProvider<P>where
P: Send,
impl<P> Sync for RecordingProvider<P>where
P: Sync,
impl<P> Unpin for RecordingProvider<P>where
P: Unpin,
impl<P> UnsafeUnpin for RecordingProvider<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for RecordingProvider<P>where
P: UnwindSafe,
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