pub struct MockLlmConfig {
pub response: String,
pub should_fail: bool,
pub failure_message: String,
}Expand description
Configuration for the LlmProvider::Mock provider.
Insert this into the Bus before executing an Axon that contains an
LlmTransition with LlmProvider::Mock to control its output.
ⓘ
bus.provide(MockLlmConfig {
response: r#"{"label":"safe","confidence":0.99}"#.to_string(),
..Default::default()
});Fields§
§response: StringThe raw text response the mock provider should return.
should_fail: boolIf true, the mock provider simulates a request failure.
failure_message: StringError message used when should_fail is true.
Trait Implementations§
Source§impl Clone for MockLlmConfig
impl Clone for MockLlmConfig
Source§fn clone(&self) -> MockLlmConfig
fn clone(&self) -> MockLlmConfig
Returns a duplicate 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 Debug for MockLlmConfig
impl Debug for MockLlmConfig
Source§impl Default for MockLlmConfig
impl Default for MockLlmConfig
Source§impl<'de> Deserialize<'de> for MockLlmConfig
impl<'de> Deserialize<'de> for MockLlmConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MockLlmConfig
impl RefUnwindSafe for MockLlmConfig
impl Send for MockLlmConfig
impl Sync for MockLlmConfig
impl Unpin for MockLlmConfig
impl UnsafeUnpin for MockLlmConfig
impl UnwindSafe for MockLlmConfig
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