pub struct AsyncMockLLM { /* private fields */ }Expand description
Async version of MockLLM that implements AsyncLanguageModel trait
Implementations§
Source§impl AsyncMockLLM
impl AsyncMockLLM
Trait Implementations§
Source§impl AsyncLanguageModel for AsyncMockLLM
impl AsyncLanguageModel for AsyncMockLLM
Source§type Error = GraphRAGError
type Error = GraphRAGError
The error type returned by generation operations
Source§fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate text completion
Source§fn complete_with_params<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
_params: GenerationParams,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_with_params<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
_params: GenerationParams,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate text with custom parameters
Source§fn complete_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generate multiple text completions concurrently
Source§fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the model is available
Source§fn model_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ModelInfo> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn model_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ModelInfo> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get model information
Source§fn get_usage_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ModelUsageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_usage_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ModelUsageStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get model usage statistics
Source§fn estimate_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn estimate_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Estimate tokens for prompt
Source§fn complete_batch_concurrent<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompts: &'life1 [&'life2 str],
max_concurrent: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete_batch_concurrent<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompts: &'life1 [&'life2 str],
max_concurrent: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generate multiple text completions with concurrency control
Source§fn complete_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<String>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<String>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate streaming completion (if supported)
Source§impl Clone for AsyncMockLLM
impl Clone for AsyncMockLLM
Source§impl Debug for AsyncMockLLM
impl Debug for AsyncMockLLM
Source§impl LLMInterface for AsyncMockLLM
Synchronous LLMInterface implementation for backward compatibility
impl LLMInterface for AsyncMockLLM
Synchronous LLMInterface implementation for backward compatibility
Auto Trait Implementations§
impl Freeze for AsyncMockLLM
impl !RefUnwindSafe for AsyncMockLLM
impl Send for AsyncMockLLM
impl Sync for AsyncMockLLM
impl Unpin for AsyncMockLLM
impl UnsafeUnpin for AsyncMockLLM
impl !UnwindSafe for AsyncMockLLM
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