pub struct MockLlm { /* private fields */ }Expand description
Deterministic backend that replays recorded responses.
Implementations§
Source§impl MockLlm
impl MockLlm
Sourcepub fn from_trace(trace: &[Record]) -> Self
pub fn from_trace(trace: &[Record]) -> Self
Build from a baseline trace.
Sourcepub fn from_traces<'a, I: IntoIterator<Item = &'a [Record]>>(traces: I) -> Self
pub fn from_traces<'a, I: IntoIterator<Item = &'a [Record]>>(traces: I) -> Self
Build from multiple traces (trace set).
Trait Implementations§
Source§impl LlmBackend for MockLlm
impl LlmBackend for MockLlm
Source§fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Given a
chat_request payload, return the corresponding
chat_response payload.Auto Trait Implementations§
impl Freeze for MockLlm
impl RefUnwindSafe for MockLlm
impl Send for MockLlm
impl Sync for MockLlm
impl Unpin for MockLlm
impl UnsafeUnpin for MockLlm
impl UnwindSafe for MockLlm
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