pub struct MockProvider { /* private fields */ }Implementations§
Source§impl MockProvider
impl MockProvider
pub fn new(response: String) -> Self
pub fn with_stream_response(responses: Vec<String>) -> Self
pub fn with_error(error: String) -> Self
Trait Implementations§
Source§impl Provider for MockProvider
impl Provider for MockProvider
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
_prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
_messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_chat<'life0, 'async_trait>(
&'life0 self,
_messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<String, Error>> + Send>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for MockProvider
impl RefUnwindSafe for MockProvider
impl Send for MockProvider
impl Sync for MockProvider
impl Unpin for MockProvider
impl UnwindSafe for MockProvider
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