pub struct MockModel { /* private fields */ }Expand description
A model that replays scripted responses in order and records every request.
Implementations§
Source§impl MockModel
impl MockModel
Sourcepub fn tool_calls(calls: &[(&str, &str, &str)]) -> Vec<ChatDelta>
pub fn tool_calls(calls: &[(&str, &str, &str)]) -> Vec<ChatDelta>
Script a response containing tool calls (id, name, arguments).
Sourcepub fn push_error(&self, error: LlmError)
pub fn push_error(&self, error: LlmError)
Append a scripted error.
Sourcepub fn requests(&self) -> Vec<ChatRequest>
pub fn requests(&self) -> Vec<ChatRequest>
Requests received so far.
Trait Implementations§
Source§impl ChatModel for MockModel
impl ChatModel for MockModel
Source§fn chat(
&self,
request: ChatRequest,
) -> BoxFuture<'_, Result<ChatStream, LlmError>>
fn chat( &self, request: ChatRequest, ) -> BoxFuture<'_, Result<ChatStream, LlmError>>
Start a streaming chat completion.
Auto Trait Implementations§
impl !Freeze for MockModel
impl Forget for MockModel
impl Move for MockModel
impl RefUnwindSafe for MockModel
impl Send for MockModel
impl Sync for MockModel
impl Unpin for MockModel
impl UnsafeUnpin for MockModel
impl UnwindSafe for MockModel
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