pub struct MockChatModel { /* private fields */ }
Expand description
A simple mock chat model for testing
Implementations§
Trait Implementations§
Source§impl BaseChatModel for MockChatModel
impl BaseChatModel for MockChatModel
Source§fn generate_chat<'life0, 'async_trait>(
&'life0 self,
_messages: Vec<AnyMessage>,
_config: Option<GenerationConfig>,
_runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<AnyMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_chat<'life0, 'async_trait>(
&'life0 self,
_messages: Vec<AnyMessage>,
_config: Option<GenerationConfig>,
_runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<AnyMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a response from chat messages
Source§fn generate_chat_batch<'life0, 'async_trait>(
&'life0 self,
conversations: Vec<Vec<AnyMessage>>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AnyMessage>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn generate_chat_batch<'life0, 'async_trait>(
&'life0 self,
conversations: Vec<Vec<AnyMessage>>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AnyMessage>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Generate responses from multiple chat conversations
Source§fn stream_chat<'life0, 'async_trait>(
&'life0 self,
messages: Vec<AnyMessage>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<AnyMessage>> + Send>>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn stream_chat<'life0, 'async_trait>(
&'life0 self,
messages: Vec<AnyMessage>,
config: Option<GenerationConfig>,
runnable_config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<AnyMessage>> + Send>>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Stream chat generation
Source§impl BaseLanguageModel for MockChatModel
impl BaseLanguageModel for MockChatModel
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 MockChatModel
impl RefUnwindSafe for MockChatModel
impl Send for MockChatModel
impl Sync for MockChatModel
impl Unpin for MockChatModel
impl UnwindSafe for MockChatModel
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