pub struct FakeLlmProvider { /* private fields */ }Implementations§
Source§impl FakeLlmProvider
impl FakeLlmProvider
pub fn new(responses: Vec<Vec<LlmResponse>>) -> Self
pub fn with_single_response(chunks: Vec<LlmResponse>) -> Self
pub fn from_results(responses: Vec<Vec<Result<LlmResponse, LlmError>>>) -> Self
pub fn with_display_name(self, name: &str) -> Self
pub fn with_context_window(self, window: Option<u32>) -> Self
Trait Implementations§
Source§impl StreamingModelProvider for FakeLlmProvider
impl StreamingModelProvider for FakeLlmProvider
fn stream_response(&self, context: &Context) -> LlmResponseStream
fn display_name(&self) -> String
Source§fn context_window(&self) -> Option<u32>
fn context_window(&self) -> Option<u32>
Context window size in tokens for the current model.
Returns
None for unknown models (e.g. Ollama, LlamaCpp).Auto Trait Implementations§
impl !Freeze for FakeLlmProvider
impl RefUnwindSafe for FakeLlmProvider
impl Send for FakeLlmProvider
impl Sync for FakeLlmProvider
impl Unpin for FakeLlmProvider
impl UnsafeUnpin for FakeLlmProvider
impl UnwindSafe for FakeLlmProvider
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> 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 moreCreates a shared type from an unshared type.