pub struct TestLLMProvider { /* private fields */ }
Implementations§
Source§impl TestLLMProvider
impl TestLLMProvider
Sourcepub fn new(config: LLMProviderConfig) -> Self
pub fn new(config: LLMProviderConfig) -> Self
Creates a new instance of TestLLMProvider
with the given configuration
pub fn set_fail_count(&self, count: usize)
pub fn set_delay(&self, delay_ms: u64)
pub fn get_total_calls(&self) -> usize
pub fn set_response(&mut self, response: String)
pub fn set_bad_response(&mut self, bad_response: String)
pub fn set_json_validation_failures(&self, count: usize)
pub fn reset(&self)
Trait Implementations§
Source§impl Clone for TestLLMProvider
impl Clone for TestLLMProvider
Source§fn clone(&self) -> TestLLMProvider
fn clone(&self) -> TestLLMProvider
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl LLMProvider for TestLLMProvider
impl LLMProvider for TestLLMProvider
Source§fn generate_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
system_prompt: &'life1 str,
user_prompt: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn generate_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
system_prompt: &'life1 str,
user_prompt: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generates a message using the Test provider (returns model name + it’s own prompts as the message)
Auto Trait Implementations§
impl Freeze for TestLLMProvider
impl RefUnwindSafe for TestLLMProvider
impl Send for TestLLMProvider
impl Sync for TestLLMProvider
impl Unpin for TestLLMProvider
impl UnwindSafe for TestLLMProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more