pub struct ReplayProvider { /* private fields */ }Expand description
Serves recorded answers in order.
Implementations§
Source§impl ReplayProvider
impl ReplayProvider
pub fn new(cassette: Cassette) -> ReplayProvider
pub fn lenient(self) -> ReplayProvider
Sourcepub fn skipping(self, played: usize) -> ReplayProvider
pub fn skipping(self, played: usize) -> ReplayProvider
Start at played rather than at the beginning.
For continuing an interrupted run: interactions are matched by position, so the second half has to pick up where the first stopped. Anything past the end leaves the provider with nothing to answer, which is the same failure a cassette that ran out already gives.
Trait Implementations§
Source§impl ModelProvider for ReplayProvider
impl ModelProvider for ReplayProvider
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 Freeze for ReplayProvider
impl RefUnwindSafe for ReplayProvider
impl Send for ReplayProvider
impl Sync for ReplayProvider
impl Unpin for ReplayProvider
impl UnsafeUnpin for ReplayProvider
impl UnwindSafe for ReplayProvider
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