pub struct MockLLM { /* private fields */ }
Expand description
A simple mock LLM for testing
Implementations§
Trait Implementations§
Source§impl BaseLLM for MockLLM
impl BaseLLM for MockLLM
Source§fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_prompt: &'life1 str,
_config: Option<GenerationConfig>,
_runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_prompt: &'life1 str,
_config: Option<GenerationConfig>,
_runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate text from a prompt
Source§fn generate_batch<'life0, 'async_trait>(
&'life0 self,
prompts: Vec<String>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LLMResult>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn generate_batch<'life0, 'async_trait>(
&'life0 self,
prompts: Vec<String>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LLMResult>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Generate text from multiple prompts
Source§fn stream_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Generation>> + Send>>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Generation>> + Send>>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream text generation
Source§impl BaseLanguageModel for MockLLM
impl BaseLanguageModel for MockLLM
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name
Source§fn model_type(&self) -> &str
fn model_type(&self) -> &str
Get the model type
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Check if the model supports streaming
Source§fn input_schema(&self) -> Option<Value>
fn input_schema(&self) -> Option<Value>
Get the input schema for this model
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
Get the output schema for this model
Auto Trait Implementations§
impl !Freeze for MockLLM
impl RefUnwindSafe for MockLLM
impl Send for MockLLM
impl Sync for MockLLM
impl Unpin 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