pub struct MapEmulator { /* private fields */ }Expand description
In-memory keyed source. The key is the last user message’s content; values are the canned responses to return.
Implementations§
Source§impl MapEmulator
impl MapEmulator
Trait Implementations§
Source§impl Default for MapEmulator
impl Default for MapEmulator
Source§fn default() -> MapEmulator
fn default() -> MapEmulator
Returns the “default value” for a type. Read more
Source§impl EmulatorSource for MapEmulator
impl EmulatorSource for MapEmulator
Source§fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 MiddlewareCtx,
) -> Pin<Box<dyn Future<Output = Option<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 MiddlewareCtx,
) -> Pin<Box<dyn Future<Output = Option<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Decide whether to emulate. Returning
Some(resp) short-circuits
the middleware chain; returning None falls through to the real
LLM.Auto Trait Implementations§
impl Freeze for MapEmulator
impl RefUnwindSafe for MapEmulator
impl Send for MapEmulator
impl Sync for MapEmulator
impl Unpin for MapEmulator
impl UnsafeUnpin for MapEmulator
impl UnwindSafe for MapEmulator
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